[Bug middle-end/15426] New: large line numbers cause crash

hebisch at math dot uni dot wroc dot pl gcc-bugzilla@gcc.gnu.org
Fri May 14 13:51:00 GMT 2004


The following program:

#line 4294967096
int main(void)
{
  return 0;
}

gives me:
../gcc/xgcc -B../gcc -g linc.c
linc.c: In function `main':
linc.c:-197: internal compiler error: in final_scan_insn, at final.c:2117
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The problem also appears with 3.5.0 20040502 snapshot (but I
must give `-g' option) and in 3.3.3. Also the problem appears
on x86 native compiler.
AFAIKS the compiler read user provided line numbers with extended
precision and then truncates then to `int'. Moreover, apparently
there is no range/overflow checking on line numbers.

-- 
           Summary: large line numbers cause crash
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hebisch at math dot uni dot wroc dot pl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



More information about the Gcc-bugs mailing list