public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/35620]  New: ICE passing dereferenced pointer to _Decimal32
@ 2008-03-18  0:05 janis at gcc dot gnu dot org
  2008-03-25 21:29 ` [Bug target/35620] " janis at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-03-18  0:05 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2096 bytes --]

This source code, compiled on powerpc-linux with -O1, results in an internal
compiler error since Peter Bergner's change to pass SDmode arguments in
floating point registers:

    extern void bar (_Decimal32);
    _Decimal32 *p;
    void
    foo (void)
    {
      bar (*p);
    }

The error message:

    elm3b145% /opt/gcc-nightly/trunk/bin/gcc -c -O1 bug.c
    bug.c: In function ‘foo’:
    bug.c:8: internal compiler error: in rs6000_secondary_memory_needed_rtx, at
config/rs6000/rs6000.c:11204
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://gcc.gnu.org/bugs.html> for instructions.

It compiles cleanly with "-O1 -fno-tree-ter".

The problem is that TER removes a temporary added to dereference "p" and
instead passes *p directly.  Code in rs6000_check_sdmode, a function Peter
added to determine whether a function needs a stack slot for passing SDmode
arguments, doesn't look for a dereference and so the temporary stack slot isn't
created.

This might fix it, but rather than jumping in and testing it thoroughly I'll
talk to Peter about it when he returns from vacation.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 133292)
+++ rs6000.c    (working copy)
@@ -11230,6 +11230,7 @@ rs6000_check_sdmode (tree *tp, int *walk
     case FIELD_DECL:
     case RESULT_DECL:
     case REAL_CST:
+    case INDIRECT_REF:
       if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode)
        return *tp;
       break;

This is a regression in GCC 4.3 (where the previous code didn't comply with the
ABI) and on mainline.


-- 
           Summary: ICE passing dereferenced pointer to _Decimal32
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis at gcc dot gnu dot org
GCC target triplet: powerpc-unknown-linux-gnu


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


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

end of thread, other threads:[~2008-09-18 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-18  0:05 [Bug target/35620] New: ICE passing dereferenced pointer to _Decimal32 janis at gcc dot gnu dot org
2008-03-25 21:29 ` [Bug target/35620] " janis at gcc dot gnu dot org
2008-04-04 20:20 ` janis at gcc dot gnu dot org
2008-06-23 19:58 ` bergner at gcc dot gnu dot org
2008-09-11 17:36 ` janis at gcc dot gnu dot org
2008-09-18 18:40 ` janis at gcc dot gnu dot 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).