public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/35492]  New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
@ 2008-03-07  2:21 hp at gcc dot gnu dot org
  2008-03-07  3:08 ` [Bug middle-end/35492] " hp at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-07  2:21 UTC (permalink / raw)
  To: gcc-bugs

With trunk r132993 and gcc-4_3-branch r132992, the following testcase yields,
with "-march=v32 -O2":
(const_int -13 [0xfffffffffffffff3])
s2.c: In function 'sk_stream_wait_connect':
s2.c:26: internal compiler error: output_operand: invalid operand for 'p'
modifier

void prepare_to_wait (void *, void *, int);
void finish_wait (void *, void *);
extern signed long schedule_timeout (signed long);
struct sock
{
  unsigned char skc_state;
  void *sk_sleep;
  int sk_err;
};

void
sk_stream_wait_connect (struct sock *sk, long *timeo_p)
{
  int done;
  int wait;
  do
    {
      if ((1 << sk->skc_state) & ~12)
        return;
      prepare_to_wait (sk->sk_sleep, &wait, 1);
      *(timeo_p) = schedule_timeout (0);
      done = !sk->sk_err;
      finish_wait (sk->sk_sleep, &wait);
    }
  while (!done);
}


-- 
           Summary: ICE building kernel sk_stream_wait_connect
                    output_operand: invalid operand for 'p' modifier
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: cris-*-* and crisv32-*-*


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


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

* [Bug middle-end/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
@ 2008-03-07  3:08 ` hp at gcc dot gnu dot org
  2008-03-13 16:55 ` hp at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-07  3:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hp at gcc dot gnu dot org  2008-03-07 03:07 -------
Also with trunk r132670.  The ICE points at the somewhat-hairy last alternative
of the *btst pattern for being at fault for not matching for the insn appearing
in 177r.greg:

(insn:QI 12 11 13 3 s2.c:18 (set (cc0)
        (zero_extract:SI (const_int -13 [0xfffffffffffffff3])
            (const_int 1 [0x1])
            (reg:SI 15 acr [orig:29 <variable>.skc_state ] [29]))) 16 {*btst}
(nil))

On closer inspection however, the condition indicates that the operands are
invalid and gcc should have noticed that, when transforming the following valid
insn into the above (from 176r.lreg):
(insn:QI 12 11 13 3 s2.c:18 (set (cc0)
        (zero_extract:SI (reg:SI 44)
            (const_int 1 [0x1])
            (reg:SI 29 [ <variable>.skc_state ]))) 16 {*btst}
(expr_list:REG_DEAD (reg:SI 29 [ <variable>.skc_state ])
        (nil)))

So, something replaces reg 44 and doesn't check the validity of the
replacement.
For 4.3, it might be safer to remove the last alternative of *btst, but for
trunk we should fix the real bug, supposedly in reload. ;)
Changing component to middle-end.


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |hp at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
          Component|target                      |middle-end
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-07 03:07:59
               date|                            |


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


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

* [Bug middle-end/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
  2008-03-07  3:08 ` [Bug middle-end/35492] " hp at gcc dot gnu dot org
@ 2008-03-13 16:55 ` hp at gcc dot gnu dot org
  2008-06-24 12:16 ` hp at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-13 16:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hp at gcc dot gnu dot org  2008-03-13 16:54 -------
Also repeatable with plain "-O1", at least for cris-*-*.


-- 


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


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

* [Bug middle-end/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
  2008-03-07  3:08 ` [Bug middle-end/35492] " hp at gcc dot gnu dot org
  2008-03-13 16:55 ` hp at gcc dot gnu dot org
@ 2008-06-24 12:16 ` hp at gcc dot gnu dot org
  2008-07-08 10:09 ` hp at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-06-24 12:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hp at gcc dot gnu dot org  2008-06-24 12:16 -------
*** Bug 36615 has been marked as a duplicate of this bug. ***


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hinko dot kocevar at
                   |                            |cetrtapot dot si


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


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

* [Bug middle-end/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-06-24 12:16 ` hp at gcc dot gnu dot org
@ 2008-07-08 10:09 ` hp at gcc dot gnu dot org
  2008-07-08 10:27 ` hp at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-08 10:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hp at gcc dot gnu dot org  2008-07-08 10:08 -------
Created an attachment (id=15874)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15874&action=view)
patch for 4.3

While I investigate just a little more, here's the regtested patch I'll commit
to the 4.3 branch. It's safe in that it just removes the offending alternative,
avoiding the problematic situation.


-- 


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


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

* [Bug middle-end/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-07-08 10:09 ` hp at gcc dot gnu dot org
@ 2008-07-08 10:27 ` hp at gcc dot gnu dot org
  2008-07-14  0:13 ` [Bug target/35492] " hp at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-08 10:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hp at gcc dot gnu dot org  2008-07-08 10:26 -------
Created an attachment (id=15875)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15875&action=view)
patch for trunk/4.4

This is one part of a correction (regtested on trunk for cris-elf). By itself,
it hides the bug by adding a constraint (redefining K to be a constraint
prefix, renaming current uses to Kc, and introducing Kp) such that the
constraints don't allow what the condition refuses.  Lots of editing, mostly
because of renaming.

Thus, it doesn't matter that the condition isn't checked.  It's correct to do
this: putting as much of the description as possible into the constraints. 
Having that check in the condition was an artefact from when GCC didn't have
multi-letter constraints.

But, reload must also be fixed to not do operand transformations that don't
also check the insn condition.  I'm still working on that part.


-- 


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-07-08 10:27 ` hp at gcc dot gnu dot org
@ 2008-07-14  0:13 ` hp at gcc dot gnu dot org
  2008-07-14  0:23 ` hp at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-14  0:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hp at gcc dot gnu dot org  2008-07-14 00:12 -------
After tests and consideration, I think we should just adjust the documentation;
the pattern condition, where it checks operands, must not be more restrictive
than the constraints.  As no code change is expected in the middle-end, I
change to component target.  Target patch commits imminent.


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |target


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-07-14  0:13 ` [Bug target/35492] " hp at gcc dot gnu dot org
@ 2008-07-14  0:23 ` hp at gcc dot gnu dot org
  2008-07-14  0:26 ` hp at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-14  0:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hp at gcc dot gnu dot org  2008-07-14 00:23 -------
Subject: Bug 35492

Author: hp
Date: Mon Jul 14 00:22:35 2008
New Revision: 137765

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137765
Log:
        PR target/35492.
        * config/cris/cris.h (CRIS_CONST_OK_FOR_LETTER_P): Renamed from
        CONST_OK_FOR_LETTER_P.  All port-local users changed.
        (CONST_OK_FOR_CONSTRAINT_P): Define; implement Kc as old K,
        implement Kp matching power-of-two.
        (CONSTRAINT_LEN): Define to match.
        * config/cris/cris.md: Replace all use of constraint K with Kc.
        ("*btst*): Use Kp for operand 0 of last alternative.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/cris/cris.c
    trunk/gcc/config/cris/cris.h
    trunk/gcc/config/cris/cris.md


-- 


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-07-14  0:23 ` hp at gcc dot gnu dot org
@ 2008-07-14  0:26 ` hp at gcc dot gnu dot org
  2008-07-14  0:27 ` hp at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-14  0:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hp at gcc dot gnu dot org  2008-07-14 00:25 -------
Subject: Bug 35492

Author: hp
Date: Mon Jul 14 00:24:35 2008
New Revision: 137766

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137766
Log:
        PR target/35492
        * gcc.c-torture/compile/pr35492.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr35492.c
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-07-14  0:26 ` hp at gcc dot gnu dot org
@ 2008-07-14  0:27 ` hp at gcc dot gnu dot org
  2008-07-14  0:29 ` hp at gcc dot gnu dot org
  2010-04-27  2:51 ` hp at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-14  0:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hp at gcc dot gnu dot org  2008-07-14 00:26 -------
Subject: Bug 35492

Author: hp
Date: Mon Jul 14 00:25:52 2008
New Revision: 137767

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137767
Log:
        PR target/35492
        * gcc.c-torture/compile/pr35492.c: New test.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/compile/pr35492.c
Modified:
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-07-14  0:27 ` hp at gcc dot gnu dot org
@ 2008-07-14  0:29 ` hp at gcc dot gnu dot org
  2010-04-27  2:51 ` hp at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-07-14  0:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hp at gcc dot gnu dot org  2008-07-14 00:29 -------
Subject: Bug 35492

Author: hp
Date: Mon Jul 14 00:28:27 2008
New Revision: 137768

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137768
Log:
        PR target/35492.
        * config/cris/cris.md ("*btst"): Remove last alternative
        and related part in the condition.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/cris/cris.md


-- 


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


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

* [Bug target/35492] ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier
  2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-07-14  0:29 ` hp at gcc dot gnu dot org
@ 2010-04-27  2:51 ` hp at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu dot org @ 2010-04-27  2:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from hp at gcc dot gnu dot org  2010-04-27 02:51 -------
This still open?  I guess I kept it open for the doc patch to go through.
It got shot down (IMHO incorrectly) but I can't be bothered to pursue.
Closing this; all codegen behavior has been fixed.

(It'd like to set milestone to 4.3.2 but that list has been pruned. :)


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |4.3.1
      Known to work|                            |4.3.2
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.5


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


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

end of thread, other threads:[~2010-04-27  2:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-07  2:21 [Bug target/35492] New: ICE building kernel sk_stream_wait_connect output_operand: invalid operand for 'p' modifier hp at gcc dot gnu dot org
2008-03-07  3:08 ` [Bug middle-end/35492] " hp at gcc dot gnu dot org
2008-03-13 16:55 ` hp at gcc dot gnu dot org
2008-06-24 12:16 ` hp at gcc dot gnu dot org
2008-07-08 10:09 ` hp at gcc dot gnu dot org
2008-07-08 10:27 ` hp at gcc dot gnu dot org
2008-07-14  0:13 ` [Bug target/35492] " hp at gcc dot gnu dot org
2008-07-14  0:23 ` hp at gcc dot gnu dot org
2008-07-14  0:26 ` hp at gcc dot gnu dot org
2008-07-14  0:27 ` hp at gcc dot gnu dot org
2008-07-14  0:29 ` hp at gcc dot gnu dot org
2010-04-27  2:51 ` hp 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).