Gcc 3.3 regressions
Alexandre Oliva
aoliva@redhat.com
Thu Sep 18 04:20:00 GMT 2003
On Sep 17, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Sep 17, 2003, "H. J. Lu" <hjl@lucon.org> wrote:
>> FAIL: gcc.dg/pack-test-2.c (test for errors, line 6)
>> Alexandre, they may have something to do with your patches.
> They do. It's apparently the same problem that caused regressions on
> Darwin in mainline. I thought -Wunknown-pragmas would have triggered
> the same path, and was convinced my patch would fix it, but it turns
> out I was wrong: pragmas for which a handler is defined don't get the
> pfile->directive_line that do_pragma() passes to def_pragma.
> def_pragma sets lineno to that line and then calls the diagnostic
> function, whereas none of the direct handlers do.
Here's a patch that fixes the problem, and that should fix the
pragma-darwin.c regression in mainline for real.
While trying to figure out what was going on, I started converting the
testcase I had for the previous patch into something suitable for the
testsuite. Even though it turns out that it exercises a different
feature from that which had the problem, I thought I'd submit the
testcase anyway.
Ok to install?
> I'm currently inclined to reintroduce the cb_line_change, but passing
> it false, like destringize_and_run() in the same file, and to do so
> right after we read the first pragma token name, or even before doing
> so, such that we don't have to pass pfile->directive_line to the
> cb_def_pragma, and all pragma handlers will have the correct line
> numbers already set up. How's that?
I found this patch would be safer, at least for 3.3. For mainline, we
could try to get rid of all cases of passing `line' explicitly to
callbacks, and always use the line_change interface, or get all pragma
handlers to handle line changing on their own. I don't quite like the
latter, but I could see its being justified if additional calls to
line_change would significantly affect performance.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp-change-line-before-pragma-handler.patch
Type: text/x-patch
Size: 2731 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030918/f4db992b/attachment.bin>
-------------- next part --------------
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
More information about the Gcc
mailing list