Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 163623 - [ICE/4.1] GCC-4.x with builtin sprintf crashes
Summary: [ICE/4.1] GCC-4.x with builtin sprintf crashes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR30473
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-24 16:56 UTC by OKUMURA N. Shin-ya
Modified: 2007-02-05 00:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Actual example, preprocessed source code (ccWLaRay.out,360 bytes, text/plain)
2007-01-24 16:58 UTC, OKUMURA N. Shin-ya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OKUMURA N. Shin-ya 2007-01-24 16:56:05 UTC
sys-devel/gcc-4.0.3 and sys-devel/gcc-4.1.1-r3 crashed with builtin sprintf.
In sys-devel/gcc-3.3.6-r1 and sys-devel/gcc-3.4.6-r2, no trouble.


Reproducible: Always

Steps to Reproduce:
1. foobar.i, just as follows;
extern int
sprintf(char *__restrict__, const char *__restrict__, ...) __attribute__ ((__nothrow__));
int main(void)
{
        char name[] = "";
        sprintf(name, "%s");
        return 0;
}
2. gcc -c foobar.i

Actual Results:  
foobar.i: In function 'main':
foobar.i:9: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Preprocessed source stored into /tmp/ccWLaRay.out file, please attach this to your bugreport.

Expected Results:  
It should be compiled.

GCC success compiling, if as follows;
$ gcc -fno-builtin foobar.i
$ gcc -fno-builtin-sprintf foobar.i
Comment 1 OKUMURA N. Shin-ya 2007-01-24 16:58:29 UTC
Created attachment 108042 [details]
Actual example, preprocessed source code
Comment 2 Luca Barbato gentoo-dev 2007-01-25 14:03:51 UTC
reproduced on ppc with gcc-4.1.1 and gcc-4.3.0-alpha20061111
Comment 3 Luca Barbato gentoo-dev 2007-01-25 14:09:26 UTC
Could you please report upstream and paste a link to their bugzilla entry here?
Comment 4 OKUMURA N. Shin-ya 2007-01-25 15:29:09 UTC
Now, I found the similar bug report in the upstream bugzilla.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30473
Comment 5 SpanKY gentoo-dev 2007-01-25 17:04:41 UTC
Luca: rarely do i ask users to submit stuff upstream with the toolchain ... it's generally been bad PR for us with the gcc people because most of the time the bug report comes of sounding like Gentoo screwed everything up
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2007-02-04 20:54:26 UTC
http://cvs.fedora.redhat.com/viewcvs/*checkout*/devel/gcc/gcc41-pr30473.patch

this will not be in 4.1.2 RC1, but as it's an ICE-on-valid it might still yet make it into the final.
Comment 7 SpanKY gentoo-dev 2007-02-05 00:02:15 UTC
ive added the patch to our cvs patchset so it'll either be in the 4.1.2 release itself or our 4.1.2 patchset

thanks Ryan