------- Comment #4 from rguenth at gcc dot gnu dot org  2007-11-13 22:38 -------
Confirmed.

#1  0x084a545e in const_binop (code=TRUNC_DIV_EXPR, arg1=0xb7cec528, 
    arg2=0xb7cec720, notrunc=0)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:1640
1640            default:
(gdb) l
1635                real = const_binop (code, t1, magsquared, notrunc);
1636                imag = const_binop (code, t2, magsquared, notrunc);
1637              }
1638              break;
1639
1640            default:
1641              gcc_unreachable ();
1642            }
1643
1644          if (real && imag)

both args are COMPLEX_CST which are not valid for TRUNC_DIV_EXPR.

#1  0x084a545e in const_binop (code=TRUNC_DIV_EXPR, arg1=0xb7cec528, 
    arg2=0xb7cec720, notrunc=0)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:1640
#2  0x084d63be in fold_binary (code=TRUNC_DIV_EXPR, type=0xb7cea844, 
    op0=0xb7cec528, op1=0xb7cec720)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:7626
#3  0x084f4704 in fold (expr=0xb7c4d2ac)
    at /home/richard/src/gcc-4_1-branch/gcc/fold-const.c:10303
#4  0x081e0b06 in fold_if_not_in_template (expr=0xb7c4d2ac)
    at /home/richard/src/gcc-4_1-branch/gcc/cp/tree.c:2334
#5  0x0818c0cb in build_binary_op (code=TRUNC_DIV_EXPR, orig_op0=0xb7cec528, 
    orig_op1=0xb7cec720, convert_p=1)
    at /home/richard/src/gcc-4_1-branch/gcc/cp/typeck.c:3594
#6  0x080576d7 in build_new_op (code=TRUNC_DIV_EXPR, flags=3, arg1=0xb7cec528, 
    arg2=0xb7cec720, arg3=0x0, overloaded_p=0xbfc21583 "")
    at /home/richard/src/gcc-4_1-branch/gcc/cp/call.c:3914
#7  0x08188321 in build_x_binary_op (code=TRUNC_DIV_EXPR, arg1=0xb7cec528, 
    arg2=0xb7cec720, overloaded_p=0xbfc21583 "")
    at /home/richard/src/gcc-4_1-branch/gcc/cp/typeck.c:2778

Indeed a C++ frontend issue and a regression from 3.4.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |4.0.4 4.1.3
      Known to work|                            |4.2.2 3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-13 22:38:08
               date|                            |
            Summary|g++ crashes on simple 20-   |[4.1 Regression] g++ crashes
                   |line source file            |on simple 20-line source
                   |                            |file


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

Reply via email to