public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43730]  New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
@ 2010-04-12 16:12 beebe at math dot utah dot edu
  2010-04-12 18:34 ` [Bug c/43730] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: beebe at math dot utah dot edu @ 2010-04-12 16:12 UTC (permalink / raw)
  To: gcc-bugs

Compilation of this test file with versions of gcc-4.5 dated 20090528 to
20100107 produce a fatal internal compiler error; comparable versions of
gcc-4.3 and gcc-4.4 do not have this problem:

% cat bug003.c
extern int (isinfl)(long double);

int
bugfun(long double x, long double y)
{
    int result;

    if (isinfl(x))
        result = isinfl(y);
    else
    {
        int kx, ky;
        kx = ky = 1;
        result = (kx == ky);
    }
    return (result);
}

% gcc-4.5-20100107  -g -c bug003.c
bug003.c: In function 'bugfun':
bug003.c:9:9: internal compiler error: in expand_builtin_interclass_mathfn, at
builtins.c:2313
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

A test with gcc-4.5-20090528 on IA-32 (triplets i686-pc-linux-gnu)
produces a similar report:
% gcc-4.5-20090528 -g -c bug003.c
bug003.c: In function 'bugfun':
bug003.c:9: internal compiler error: in expand_builtin_interclass_mathfn, at
builtins.c:2297


-- 
           Summary: internal compiler error: in
                    expand_builtin_interclass_mathfn, at builtins.c:2313
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: beebe at math dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c/43730] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
@ 2010-04-12 18:34 ` pinskia at gcc dot gnu dot org
  2010-04-12 18:38 ` [Bug middle-end/43730] [4.5/4.6 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-12 18:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-04-12 18:34 -------
Still ICEd as of 20100401.


-- 


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
  2010-04-12 18:34 ` [Bug c/43730] " pinskia at gcc dot gnu dot org
@ 2010-04-12 18:38 ` pinskia at gcc dot gnu dot org
  2010-04-12 18:39 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-12 18:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-04-12 18:38 -------
And as of:
gcc version 4.6.0 20100408 (experimental) [trunk revision 158138] (GCC) 

So confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-12 18:38:24
               date|                            |
            Summary|internal compiler error: in |[4.5/4.6 Regression]
                   |expand_builtin_interclass_ma|internal compiler error: in
                   |thfn, at builtins.c:2313    |expand_builtin_interclass_ma
                   |                            |thfn, at builtins.c:2313
   Target Milestone|---                         |4.5.0


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
  2010-04-12 18:34 ` [Bug c/43730] " pinskia at gcc dot gnu dot org
  2010-04-12 18:38 ` [Bug middle-end/43730] [4.5/4.6 Regression] " pinskia at gcc dot gnu dot org
@ 2010-04-12 18:39 ` pinskia at gcc dot gnu dot org
  2010-04-13  9:02 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-12 18:39 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major
  GCC build triplet|x86_64-unknown-linux-gnu    |
   GCC host triplet|x86_64-unknown-linux-gnu    |


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
                   ` (2 preceding siblings ...)
  2010-04-12 18:39 ` pinskia at gcc dot gnu dot org
@ 2010-04-13  9:02 ` rguenth at gcc dot gnu dot org
  2010-04-13 11:59 ` matz at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-13  9:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-04-13 09:02 -------
Micha - compared to 4.4 we arrive with

(gdb) call debug_rtx (target)
(mem/c/i:SI (plus:DI (reg/f:DI 54 virtual-stack-vars)
        (const_int -4 [0xfffffffffffffffc])) [0 result+0 S4 A32])

instead of

(gdb) call debug_rtx (target)
(reg:SI 59 [ D.1598 ])

which isn't valid for

(define_expand "isinfxf2"
  [(use (match_operand:SI 0 "register_operand" ""))
   (use (match_operand:XF 1 "register_operand" ""))]
  "TARGET_USE_FANCY_MATH_387
   && TARGET_C99_FUNCTIONS"

but we assert that it is.  Do we never expect a MEM for target or why were
we lucky before?

I can obviously "fix" this by

Index: builtins.c
===================================================================
--- builtins.c  (revision 158225)
+++ builtins.c  (working copy)
@@ -2316,6 +2316,7 @@ expand_builtin_interclass_mathfn (tree e
       tree orig_arg = arg;
       /* Make a suitable register to place result in.  */
       if (!target
+         || !REG_P (target)
          || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
          target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at gcc dot gnu dot org


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
                   ` (3 preceding siblings ...)
  2010-04-13  9:02 ` rguenth at gcc dot gnu dot org
@ 2010-04-13 11:59 ` matz at gcc dot gnu dot org
  2010-04-13 13:35 ` matz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-13 11:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from matz at gcc dot gnu dot org  2010-04-13 11:59 -------
No, we shouldn't unconditionally create REGs if the target isn't one, but
rather only if it doesn't match the predicate.  Like so, which I'm testing
right now:

Index: builtins.c
===================================================================
--- builtins.c  (revision 158160)
+++ builtins.c  (working copy)
@@ -2316,7 +2316,8 @@ expand_builtin_interclass_mathfn (tree e
       tree orig_arg = arg;
       /* Make a suitable register to place result in.  */
       if (!target
-         || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
+         || GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp))
+         || !insn_data[icode].operand[0].predicate (target, GET_MODE
(target)))
          target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp)));

       gcc_assert (insn_data[icode].operand[0].predicate


-- 

matz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |matz at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-04-12 18:38:24         |2010-04-13 11:59:00
               date|                            |


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
                   ` (4 preceding siblings ...)
  2010-04-13 11:59 ` matz at gcc dot gnu dot org
@ 2010-04-13 13:35 ` matz at gcc dot gnu dot org
  2010-04-13 13:47 ` matz at gcc dot gnu dot org
  2010-04-13 13:54 ` matz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-13 13:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from matz at gcc dot gnu dot org  2010-04-13 13:35 -------
Subject: Bug 43730

Author: matz
Date: Tue Apr 13 13:35:30 2010
New Revision: 158268

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158268
Log:
        PR middle-end/43730
        * builtins.c (expand_builtin_interclass_mathfn): Also create
        a register if the predicate doesn't match.

testsuite/
        * gcc.dg/pr43730.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr43730.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
                   ` (5 preceding siblings ...)
  2010-04-13 13:35 ` matz at gcc dot gnu dot org
@ 2010-04-13 13:47 ` matz at gcc dot gnu dot org
  2010-04-13 13:54 ` matz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-13 13:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from matz at gcc dot gnu dot org  2010-04-13 13:47 -------
Subject: Bug 43730

Author: matz
Date: Tue Apr 13 13:47:11 2010
New Revision: 158270

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158270
Log:
        PR middle-end/43730
        * builtins.c (expand_builtin_interclass_mathfn): Also create
        a register if the predicate doesn't match.

testsuite/
        * gcc.dg/pr43730.c: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/pr43730.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/builtins.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/43730] [4.5/4.6 Regression] internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313
  2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
                   ` (6 preceding siblings ...)
  2010-04-13 13:47 ` matz at gcc dot gnu dot org
@ 2010-04-13 13:54 ` matz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: matz at gcc dot gnu dot org @ 2010-04-13 13:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from matz at gcc dot gnu dot org  2010-04-13 13:54 -------
Fixed.


-- 

matz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-04-13 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12 16:12 [Bug c/43730] New: internal compiler error: in expand_builtin_interclass_mathfn, at builtins.c:2313 beebe at math dot utah dot edu
2010-04-12 18:34 ` [Bug c/43730] " pinskia at gcc dot gnu dot org
2010-04-12 18:38 ` [Bug middle-end/43730] [4.5/4.6 Regression] " pinskia at gcc dot gnu dot org
2010-04-12 18:39 ` pinskia at gcc dot gnu dot org
2010-04-13  9:02 ` rguenth at gcc dot gnu dot org
2010-04-13 11:59 ` matz at gcc dot gnu dot org
2010-04-13 13:35 ` matz at gcc dot gnu dot org
2010-04-13 13:47 ` matz at gcc dot gnu dot org
2010-04-13 13:54 ` matz 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).