------- Additional Comments From uttamp at us dot ibm dot com  2005-05-26 18:23 
-------
(In reply to comment #0)
> test case:
> $ cat bug1.c
> void f1()
> {
>   long bit=0, exponent;
>   exponent = -exponent;
>   for (bit = 1; exponent; bit <<= 1)
>       if (exponent & bit)
>               exponent ^= bit;
> }
> 
> # Compilation parameters
> $ gcc -c -O3 -m64 bug1,c
> 
> gcc gives internal compiler error on Powerpc platform.
> 
> bug1.c: In function &#8216;f1&#8217;:
> bug1.c:8: error: could not split insn
> (insn:TI 13 11 14 (parallel [
>             (set (reg:CC 75 7 [125])
>                 (compare:CC (neg:DI (reg/v:DI 0 0 [orig:119 exponent ] [119]))
>                     (const_int 0 [0x0])))
>             (set (reg/v:DI 0 0 [orig:118 exponent.1 ] [118])
>                 (neg:DI (reg/v:DI 0 0 [orig:119 exponent ] [119])))
>         ]) 76 {*rs6000.md:1653} (nil)
>     (nil))
> bug1.c:8: internal compiler error: in final_scan_insn, at final.c:2419
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> 
> Compiler works with all other optimization flags.

I didn't mean to mislead anybody with my earlier comment. But actually compiler
fails with all optimization flags (-O2 and above). And a test case also has one
change to make it more generic type. In the original test case 'exponent' was
just a local and unitialized variable.

void f1(long exponent)
{
   long bit=0;
   exponent = -exponent;
   for (bit = 1; exponent; bit <<= 1)
       if (exponent & bit)
               exponent ^= bit;
}

> 
> After doing reghunt I found a patch, which may not necessarily have caused the
> above failure but compiler started failing after application of this patch, 
> 
> http://gcc.gnu.org/ml/gcc-cvs/2005-05/msg00232.html



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21761

Reply via email to