public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/15340] New: GCC internal error in preprocessed C code
@ 2004-05-07 19:56 gcc-bugzilla at gcc dot gnu dot org
  2004-05-08  3:41 ` [Bug target/15340] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-05-07 19:56 UTC (permalink / raw)
  To: gcc-bugs

	GCC throws an internal compiler error on the following code when run with optimizations. Bug exists in 3.2, 3.3, and 3.4.

Environment:
System: Linux mrbean 2.6.1 #1 Wed Jan 21 16:45:49 CST 2004 i686 GNU/Linux
Architecture: i686
    libc: 2.3.2.ds1-12 (Debian)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
Configured with: ./configure --enable-languages=c --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-debug

How-To-Repeat:
Here's the command-line I ran with output:
davedude@mrbean:/usr/src/gcc-3.4.0/gcc$ ./xgcc -B. -v -O2 -fno-strict-aliasing ~/c/uiuc/cs348/mp6/bug.i
Reading specs from ./specs
Configured with: ./configure --enable-languages=c --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-debug
Thread model: posix
gcc version 3.4.0
 ./cc1 -fpreprocessed /home/davedude/c/uiuc/cs348/mp6/bug.i -quiet -dumpbase bug.i -mtune=pentiumpro -auxbase bug -O2 -version -fno-strict-aliasing -o /tmp/ccOtjqJK.s
GNU C version 3.4.0 (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.3 (Debian 20040401).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32090
bug.c: In function `main':
bug.c:20: error: insn does not satisfy its constraints:
(insn:HI 41 40 53 2 (set (reg/v:SI 3 bx [orig:74 y ] [74])
        (sign_extend:SI (mem/s/j:QI (mult:SI (plus:SI (reg/f:SI 6 bp)
                        (const_int -13 [0xfffffff3]))
                    (const_int 2 [0x2])) [0 dir S1 A8]))) 86 {extendqisi2} (nil)
    (nil))
bug.c:20: internal compiler error: in reload_cse_simplify_operands, at postreload.c:378
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Here's bug.i:

# 1 "bug.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "bug.c"
int globl;

void dummy(char arg)
{
    globl = arg;
}

int main(int argc, char *argv[])
{
    char dir[1];
    int y = 0, best;

    while (y > *argv[0])
    {
        best = (int)dir;
        y = dir[best];
        dummy(*argv[1|best]);
    }
    return 0;
}
------- Additional Comments From dawalker at uiuc dot edu  2004-05-07 19:56 -------
Fix:
	Bug only appears with optimizations on. Also, this is as small as I could make
	the bug. Most changes to the above code will remove the problem. Although the
	code is obviously artificial, the problem did crop up in real code originally.

-- 
           Summary: GCC internal error in preprocessed C code
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dawalker at uiuc dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
@ 2004-05-08  3:41 ` pinskia at gcc dot gnu dot org
  2004-06-06  3:57 ` giovannibajo at libero dot it
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-08  3:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-08 03:41 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|optimization                |target
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |3.2.2 3.2.3 3.4.0 3.5.0
      Known to work|                            |3.0.4
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-08 03:41:15
               date|                            |
            Summary|GCC internal error in       |[3.3/3.4/3.5 Regression] GCC
                   |preprocessed C code         |internal error in
                   |                            |preprocessed C code
   Target Milestone|---                         |3.3.4
            Version|3.4                         |3.4.0


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
  2004-05-08  3:41 ` [Bug target/15340] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-06-06  3:57 ` giovannibajo at libero dot it
  2004-06-22 12:47 ` roger at eyesopen dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2004-06-06  3:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-06-06 03:57 -------
Retargeting to 3.4.1, being a regression on that release branch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at gcc dot gnu dot org
   Target Milestone|3.3.4                       |3.4.1


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
  2004-05-08  3:41 ` [Bug target/15340] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
  2004-06-06  3:57 ` giovannibajo at libero dot it
@ 2004-06-22 12:47 ` roger at eyesopen dot com
  2004-06-24 21:23 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: roger at eyesopen dot com @ 2004-06-22 12:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger at eyesopen dot com  2004-06-22 12:47 -------
This looks to be a bug in reload, or a problem with the x86 backend's constraint
matching.

In .19.life, we have

(insn 38 33 39 2 (set (reg:QI 84)
        (mem/s:QI (plus:SI (reg/f:SI 93)
                (reg/f:SI 93)) [0 dir S1 A8])) 46 {*movqi_1} (nil)
    (nil))

(insn 39 38 42 2 (set (reg/v:SI 63 [ y ])
        (sign_extend:SI (reg:QI 84))) 86 {extendqisi2} (insn_list 38 (nil))
    (expr_list:REG_DEAD (reg:QI 84)
        (nil)))

These get smushed in combine, but I believe are stiil valid in .20.combine

(insn 39 38 42 2 (set (reg/v:SI 63 [ y ])
        (sign_extend:SI (mem/s:QI (mult:SI (reg/f:SI 93)
                    (const_int 2 [0x2])) [0 dir S1 A8]))) 86 {extendqisi2} (nil)
    (nil))

But everything goes to hell in reload, as we consider substituting pseduo 93
for "(plus (reg/f:SI bp) (const_int -13))", producing this monster in .26.greg

Reloads for insn # 39
Reload 0: reload_in (QI) = (mem/s:QI (mult:SI (plus:SI (reg/f:SI 6 bp)
  (const_int -13 [0xfffffff3])) (const_int 2 [0x2])) [0 dir S1 A8])
        Q_REGS, RELOAD_FOR_INPUT (opnum = 1), optional
        reload_in_reg: (mem/s:QI (mult:SI (plus:SI (reg/f:SI 6 bp)
  (const_int -13 [0xfffffff3])) (const_int 2 [0x2])) [0 dir S1 A8])


(insn:HI 39 38 42 2 (set (reg/v:SI 3 bx [orig:63 y ] [63])
        (sign_extend:SI (mem/s:QI (mult:SI (plus:SI (reg/f:SI 6 bp)
                        (const_int -13 [0xfffffff3]))
                    (const_int 2 [0x2])) [0 dir S1 A8]))) 86 {extendqisi2} (nil)
    (nil))


-- 


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-22 12:47 ` roger at eyesopen dot com
@ 2004-06-24 21:23 ` pinskia at gcc dot gnu dot org
  2004-07-02 16:44 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-24 21:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-24 21:17 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01980.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-06-24 21:23 ` pinskia at gcc dot gnu dot org
@ 2004-07-02 16:44 ` mmitchel at gcc dot gnu dot org
  2004-08-12  8:14 ` steven at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-07-02 16:44 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.2


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-07-02 16:44 ` mmitchel at gcc dot gnu dot org
@ 2004-08-12  8:14 ` steven at gcc dot gnu dot org
  2004-08-29 18:12 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-08-12  8:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-08-12 08:14 -------
rth commented on the patch and the discussion died out.  Suggestions? 
 

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


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-08-12  8:14 ` steven at gcc dot gnu dot org
@ 2004-08-29 18:12 ` mmitchel at gcc dot gnu dot org
  2004-08-29 18:16 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-29 18:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-08-29 18:12 -------
Postponed until GCC 3.4.3.

-- 


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


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

* [Bug target/15340] [3.3/3.4/3.5 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-08-29 18:12 ` mmitchel at gcc dot gnu dot org
@ 2004-08-29 18:16 ` mmitchel at gcc dot gnu dot org
  2004-09-13  9:25 ` [Bug target/15340] [3.3/3.4 " rth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-29 18:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-08-29 18:14 -------
Postponed until GCC 3.4.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.2                       |3.4.3


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


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

* [Bug target/15340] [3.3/3.4 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-08-29 18:16 ` mmitchel at gcc dot gnu dot org
@ 2004-09-13  9:25 ` rth at gcc dot gnu dot org
  2004-09-27  4:12 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-09-13  9:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-09-13 09:25 -------
No ICE on mainline as of 2004-09-12.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|rth at gcc dot gnu dot org  |
      Known to fail|3.2.2 3.2.3 3.4.0 4.0       |3.2.2 3.2.3 3.4.0
      Known to work|3.0.4                       |3.0.4 4.0.0
            Summary|[3.3/3.4/3.5 Regression] GCC|[3.3/3.4 Regression] GCC
                   |internal error in           |internal error in
                   |preprocessed C code         |preprocessed C code


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


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

* [Bug target/15340] [3.3/3.4 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-09-13  9:25 ` [Bug target/15340] [3.3/3.4 " rth at gcc dot gnu dot org
@ 2004-09-27  4:12 ` pinskia at gcc dot gnu dot org
  2004-11-01  0:47 ` mmitchel at gcc dot gnu dot org
  2005-05-19 17:50 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-27  4:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-27 04:12 -------
Patch keyword removed as the patch was rejected by RTH.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |


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


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

* [Bug target/15340] [3.3/3.4 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-09-27  4:12 ` pinskia at gcc dot gnu dot org
@ 2004-11-01  0:47 ` mmitchel at gcc dot gnu dot org
  2005-05-19 17:50 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-01  0:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-01 00:46 -------
Postponed until GCC 3.4.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.3                       |3.4.4


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


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

* [Bug target/15340] [3.3/3.4 Regression] GCC internal error in preprocessed C code
  2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2004-11-01  0:47 ` mmitchel at gcc dot gnu dot org
@ 2005-05-19 17:50 ` mmitchel at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:50 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

end of thread, other threads:[~2005-05-19 17:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-07 19:56 [Bug optimization/15340] New: GCC internal error in preprocessed C code gcc-bugzilla at gcc dot gnu dot org
2004-05-08  3:41 ` [Bug target/15340] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-06-06  3:57 ` giovannibajo at libero dot it
2004-06-22 12:47 ` roger at eyesopen dot com
2004-06-24 21:23 ` pinskia at gcc dot gnu dot org
2004-07-02 16:44 ` mmitchel at gcc dot gnu dot org
2004-08-12  8:14 ` steven at gcc dot gnu dot org
2004-08-29 18:12 ` mmitchel at gcc dot gnu dot org
2004-08-29 18:16 ` mmitchel at gcc dot gnu dot org
2004-09-13  9:25 ` [Bug target/15340] [3.3/3.4 " rth at gcc dot gnu dot org
2004-09-27  4:12 ` pinskia at gcc dot gnu dot org
2004-11-01  0:47 ` mmitchel at gcc dot gnu dot org
2005-05-19 17:50 ` mmitchel 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).