public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/61044] New: Computed goto on AVR fails to use word-addressing
@ 2014-05-03 11:57 dinuxbg at gmail dot com
  2014-05-03 12:06 ` [Bug target/61044] " dinuxbg at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dinuxbg at gmail dot com @ 2014-05-03 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61044
           Summary: Computed goto on AVR fails to use word-addressing
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dinuxbg at gmail dot com

Created attachment 32727
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32727&action=edit
Failed computed goto C example

The computed goto example taken straight from the GCC manual generates
incorrect code for AVR. When doing pointer arithmetic, the compiler fails to
mark labels with gs.

The following snippet from the attached test_fail C function:
    static const int array[] = { &&foo - &&foo, &&bar - &&foo, &&hack - &&foo
};
will generate the following rodata:
array.1464:
        .word   0
        .word   .L3-(.L2)
        .word   .L4-(.L2)


Note that straight labels without arithmetics work just fine (see test_good in
attached cg.c):
array.1472:
        .word   gs(.L2)
        .word   gs(.L3)
        .word   gs(.L4)

I've tested with avr-gcc 4.8.2 from debian sid. But I believe bug is also
present in top of tree.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-28 17:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-03 11:57 [Bug target/61044] New: Computed goto on AVR fails to use word-addressing dinuxbg at gmail dot com
2014-05-03 12:06 ` [Bug target/61044] " dinuxbg at gmail dot com
2014-05-23  8:53 ` gjl at gcc dot gnu.org
2014-05-27 11:48 ` senthil_kumar.selvaraj at atmel dot com
2014-05-28  8:43 ` gjl at gcc dot gnu.org
2014-05-28  8:44 ` gjl at gcc dot gnu.org
2014-05-28  8:48 ` gjl at gcc dot gnu.org
2014-05-28  8:50 ` gjl at gcc dot gnu.org
2014-05-28  8:53 ` gjl at gcc dot gnu.org
2014-05-28 17:29 ` gjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).