Bug in CPP - egcs-1.1 release

Kars de Jong jongk@prac.cs.utwente.nl
Wed Sep 16 10:50:00 GMT 1998


Hello,

I'd like to report a bug in egcs-1.1 release.
It is a bug in the C preprocessor which shows up when you use a macro with
inline assembly code which spans multiple lines. In previous versions, the
macro would show up in the preprocessed code as being on one line, now it
keeps it very much like the macro definition. An example (m68k assembly):

#define FROG() \
__asm__("move.l %%d0,%-\n  \
         move.l %%d1,%-\n  \
         move.l %%d2,%-\n" \
        : : : "cc", "memory");

However, the cpp doesn't emit new #line directives, so after such a macro
is used the line numbers in the file are off when a warning or error is
printed by egcs. Also, the debugging line number info is wrong (when you
use gdb it prints the wrong line of code in a backtrace).
I have only seen this on a m68k-unknown-linux-gnu system using GLIBC 2.0.95,
but I assume it will show up on all systems.
The solution would probably consist of adding a #line directive right
after a macro definition, or to put it all back on one line.

Best regards,

Kars.
------------------------------------------------------------------------------
Kars de Jong             Signaalkamp rules the waves!       Turrican@Discworld
--------======]**-----|      jongk@cs.utwente.nl      |-----**[======---------



More information about the Gcc-bugs mailing list