Bug 112678
| Summary: | gcc -O2 hangs compiler | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Gene Czarcinski <gczarcinski> | ||||||
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 1 | CC: | 64bit_fedora | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 3.3.2-6 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2004-10-02 18:12:43 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Gene Czarcinski
2003-12-27 21:52:33 UTC
Please attach preprocessed network.i (add -save-temps option to gcc when compiling network.c) and write what exact other compiler flags you've used to make it hang. The only parameter difference is -O2. Here are the two command line entries: with -O2: gcc -pipe -I../ -DHAVE_CONFIG_H -DNESSUS_ON_SSL -I. -I/usr/kerberos/include -DHAVE_SSL -I/usr/include/openssl -I/home/genec/devel/redhat/BUILD/nessus-libraries/include -I/home/genec/devel/redhat/BUILD/nessus-libraries/libpcap-nessus -g -O2 -save-temps -pipe -c network.c -fPIC -DPIC -o .libs/network.lo without -O2: gcc -pipe -I../ -DHAVE_CONFIG_H -DNESSUS_ON_SSL -I. -I/usr/kerberos/include -DHAVE_SSL -I/usr/include/openssl -I/home/genec/devel/redhat/BUILD/nessus-libraries/include -I/home/genec/devel/redhat/BUILD/nessus-libraries/libpcap-nessus -g -save-temps -pipe -c network.c -fPIC -DPIC -o .libs/network.lo Since the network.i output is different for the -O2 and non-O2 cases, I am attaching both. Created attachment 96708 [details]
network.i without the -O2 parameter
Created attachment 96709 [details]
network.i when -O2 specified and gcc hangs
I ran some additional tests. Using the general form of "gcc -c -o xxx" and either of the attached files .. With nothing or -O1 specified, it takes about 1 second to compile. With -O2, -O3, or -Os, the compile hangs. The compile (-O2) also works OK when these files are compiled on a dual Athlon for the network.i generated by -O2 on the Opteron x86_64 system. Simplified to:
extern int f1 (int, void *);
extern int *f2 (void) __attribute__ ((__const__));
extern int f3 (int, void *);
int
test (int x, char *y, int z)
{
int b = 0;
if (x < 1024)
{
y[0] = '\0';
do
{
switch (f1 (x, y + b))
{
case -1:
if (b == 0)
return -1;
else
return b;
default:
b++;
}
}
while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
}
else
{
do
{
switch (f3 (x, y + b))
{
case -1:
if ((*f2 ()) == 4)
continue;
if (b == 0)
return -1;
else
return b;
default:
b++;
}
}
while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
}
return b;
}
1. patch works! I took the 3.3.2-5 version of src.rpm, applied the patch (after some fiddling but no real changes), rebuilt all of gcc and installed. Then I ran the rpmbuild for libnessus which had hung and it not compiles just fine. 2. I would appreciate it if this patch could be installed into a "development" version of gcc since that will make it easier to incorporate into the x86_64 version of FC1 (as an update if not in the base). Thanks Jakub! Now I need to play with the nessus rpms to get it to properly handle being on a x86_64 system (/usr/lib64, etc). not => now Was this patch added to the current release or testing release? I applied the above patch to gcc-3-3-2-5 and rebuild ... it fixed the problem. This fix has been incorporated into gcc-3.3.2-6 (last seen in development). I have since rebuilt gcc-3.3.2-6 (src.rpm from development) for the x86_64 and installed it ... it also fixes the loop problem. I see that development currently has gcc-3.3.2-8 (which probably works but I have not tried it). The binaries I did are on ftp://czarc.net/pub/x86_64 ... if you need the 3.3.2-6 src.rpm, I can upload it. When I get a change, I will rebuild to gcc-3.3.2-8. BTW, you need glibc-devel for the i386(!!) to build gcc. Since that is true, it probably should be part of the distribution. |