public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53461] New: Incorrect handling of CASE_VECTOR_PC_RELATIVE in config/m68k.md
@ 2012-05-23 17:16 gvvn1200 at gmail dot com
  2012-05-26 15:09 ` [Bug target/53461] " gvvn1200 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gvvn1200 at gmail dot com @ 2012-05-23 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53461
           Summary: Incorrect handling of CASE_VECTOR_PC_RELATIVE in
                    config/m68k.md
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gvvn1200@gmail.com


I have been trying to port a recent gcc version to m68k-next-nextstep3 target
and encountered an ICE in the stage1 compiler.  With help of the m68k debian
ports community I was able to identify a bug in config/m68k/m68k.md.  This bug
exists in all reasonably recent versions of gcc but not in gcc-3.2 and gcc-3.4.

The m68k.md file contains the following conditional statement:

#ifdef CASE_VECTOR_PC_RELATIVE
   operands[0] = gen_rtx_PLUS (SImode, pc_rtx,
                gen_rtx_SIGN_EXTEND (SImode, operands[0]));
#endif

If the target configuration files undefine CASE_VECTOR_PC_RELATIVE, the
defaults.h header redefines CASE_VECTOR_PC_RELATIVE as follows:

/* Assume that case vectors are not pc-relative.  */
#ifndef CASE_VECTOR_PC_RELATIVE
#define CASE_VECTOR_PC_RELATIVE 0
#endif

The defaults.h header file is included after the target configuration files and
thus overrides the CASE_VECTOR_PC_RELATIVE.  The conditional statement in
config/m68k/m68k.md is therefore always satisfied even if the target
configuration undefines CASE_VECTOR_PC_RELATIVE.

I was able to resolve the issue with the following change to
config/m68k/m68k.md:

#if CASE_VECTOR_PC_RELATIVE != 0
   operands[0] = gen_rtx_PLUS (SImode, pc_rtx,
                gen_rtx_SIGN_EXTEND (SImode, operands[0]));
#endif

t-rexky


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

end of thread, other threads:[~2012-06-04 13:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 17:16 [Bug target/53461] New: Incorrect handling of CASE_VECTOR_PC_RELATIVE in config/m68k.md gvvn1200 at gmail dot com
2012-05-26 15:09 ` [Bug target/53461] " gvvn1200 at gmail dot com
2012-06-04 13:13 ` schwab at gcc dot gnu.org
2012-06-04 13:14 ` schwab@linux-m68k.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).