Bug 41150 - segmentation fault after using __attribute__((optimize()))
Summary: segmentation fault after using __attribute__((optimize()))
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-24 03:12 UTC by liangpeng
Modified: 2010-03-30 02:41 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
The preprocessed file that triggers bug 1 (16.38 KB, text/plain)
2009-09-07 07:08 UTC, liangpeng
Details
The preprocessed file that triggers bug 2 (17.59 KB, text/plain)
2009-09-07 07:09 UTC, liangpeng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description liangpeng 2009-08-24 03:12:36 UTC
Bug 1: 
A segmentation fault(rhs_regno (x=0x0) rtl.h:1005) will come
up if we: delcare function Mibench > automotive_susan_e >
susan.c:susan_edges_small() with __attribute__((optimize(3))) 

complete command line and compiler output :
$~/ici/install/bin/gcc -lm -O0 -c susan.c                                       susan.c: In function ¡®susan_edges_small¡¯:
susan.c:1426: internal compiler error: Segmentation fault

Bug 2:
A segmentation fault(ipa-cp.c ipcp_lattice_changed (old_lat=0x7ffffbf46080,  new_lat=0x0)) will come up
if we:
declare function Mibench > automotive_susan_e >
susan.c:susan_edges() with __attribute__((optimize(3))) 
declare function Mibench > automotive_susan_e >
susan.c:susan_edges_small() with __attribute__((optimize(1))) 
declare function Mibench > automotive_susan_e >
susan.c:susan_corners_quick() with __attribute__((optimize(3))) 

complete command line and compiler output :
$~/ici/install/bin/gcc -lm -O3 -c susan.c
susan.c:2122: internal compiler error: Segmentation fault

System type:
Using built-in specs.
Target: x86_64-unknown-linux-gnu

Configured with: 
../../../gcc-ici/branches/gcc-4.4.0-ici-2.0-adapt/configure --prefix=/home/lpeng/ici/install --with-mpfr=/home/common/tools/mpfr-2.4.1 --with-gmp=/home/common/tools/gmp-4.3.1 --with-ppl=/home/common/tools/ppl-0.10.2 --with-cloog=/home/common/tools/cloog --enable-languages=c,fortran
Thread model: posix

Release:
gcc version 4.4.0 (GCC)
Comment 1 Richard Biener 2009-08-24 09:08:38 UTC
Please provide preprocessed source that can be used to reproduce the failure.
Comment 2 liangpeng 2009-09-07 07:08:38 UTC
Created attachment 18524 [details]
The preprocessed file that triggers bug 1
Comment 3 liangpeng 2009-09-07 07:09:00 UTC
Created attachment 18525 [details]
The preprocessed file that triggers bug 2
Comment 4 Jie Zhang 2010-03-29 13:59:47 UTC
bug2-susan.i does not crash ICE on GCC SVN trunk now.
Comment 5 Jie Zhang 2010-03-29 14:00:48 UTC

*** This bug has been marked as a duplicate of 43562 ***
Comment 6 Jie Zhang 2010-03-29 14:16:44 UTC
I means only bug1-susan.i is a duplicate of PR 43562.

bug2-susan.i still exists on gcc 4.4 branch head.
Comment 7 Jie Zhang 2010-03-29 16:22:14 UTC
bug2-susan.i still exists on gcc 4.4 branch head. So reopen it.
Comment 8 liangpeng 2010-03-30 02:09:16 UTC
(In reply to comment #7)
> bug2-susan.i still exists on gcc 4.4 branch head. So reopen it.
> 

Yes, It was true that bug1-susan.i was a duplicate of PR 43562, we used the same way like you suggestion 1 to fix it temporarily. And I think your second try provided a better solution. Thank you! 
Comment 9 liangpeng 2010-03-30 02:14:03 UTC
(In reply to comment #4)
> bug2-susan.i does not crash ICE on GCC SVN trunk now.
> 

Do you mean bug2-susan.i does not exist on GCC 4.5?
Comment 10 Jie Zhang 2010-03-30 02:41:24 UTC
(In reply to comment #9)
> (In reply to comment #4)
> > bug2-susan.i does not crash ICE on GCC SVN trunk now.
> > 
> 
> Do you mean bug2-susan.i does not exist on GCC 4.5?
> 
I don't see it on latest GCC 4.5.