public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/33122]  New: Mistaken type mismatch error prevents bootstrap
@ 2007-08-20 13:42 nickc at redhat dot com
  2007-08-20 13:46 ` [Bug bootstrap/33122] " nickc at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nickc at redhat dot com @ 2007-08-20 13:42 UTC (permalink / raw)
  To: gcc-bugs

Bootstrapping gcc from the 19 Aug 2008 mainline sources (and possibly earlier
and/or later) with an integrated source tree containing the binutils mainline
sources fails with:

  gcc/current/opcodes/i386-dis.c: In function 'dofloat':
  gcc/current/opcodes/i386-dis.c:4193: error: type mismatch in pointer plus
expression
  struct dis386 *

  struct dis386[8] *

  long unsigned int

  dp = &float_reg + D.7971

The source line in question (line 4213 in opcodes/i386-dis.c) is correct:

 dp = &float_reg[floatop - 0xd8][modrm.reg];

where dp is a "const struct dis386 *" and float_reg is a "const struct dis386
[][8]"


-- 
           Summary: Mistaken type mismatch error prevents bootstrap
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nickc at redhat dot com
 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=33122


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

* [Bug bootstrap/33122] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
@ 2007-08-20 13:46 ` nickc at redhat dot com
  2007-08-20 15:31 ` [Bug c/33122] " rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nickc at redhat dot com @ 2007-08-20 13:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from nickc at redhat dot com  2007-08-20 13:46 -------
Created an attachment (id=14080)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14080&action=view)
Compressed, pre-processed source file used to reproduce the problem

This source file was compiled with this command line:

cc1 -fpreprocessed i386-dis.i -quiet -dumpbase i386-dis.c -mtune=generic
-auxbase-strip i386-dis.o -g -O2 -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -version -o i386-dis.s

which was executed by gcc from this original command line:

/work/sources/non-sources/builds/maintainer/FSF/FSF-bootstrap/./prev-gcc/xgcc
-B/work/sources/non-sources/builds/maintainer/FSF/FSF-bootstrap/./prev-gcc/
-B/work/sources/non-sources/builds/maintainer/FSF/FSF-bootstrap/install/x86_64-unknown-linux-gnu/bin/
-DHAVE_CONFIG_H -I. -I/work/sources/gcc/current/opcodes -I. -D_GNU_SOURCE -I.
-I/work/sources/gcc/current/opcodes -I../bfd
-I/work/sources/gcc/current/opcodes/../include
-I/work/sources/gcc/current/opcodes/../bfd -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -g -O2 -c
/work/sources/gcc/current/opcodes/i386-dis.c -o i386-dis.o --save-temps -v


-- 


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


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

* [Bug c/33122] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
  2007-08-20 13:46 ` [Bug bootstrap/33122] " nickc at redhat dot com
@ 2007-08-20 15:31 ` rguenth at gcc dot gnu dot org
  2007-08-20 15:40 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-20 15:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-08-20 15:30 -------
Reduced testcase:

struct dis386 {
  const char *x;
};

static const struct dis386 float_reg[][2] = {
  { { "fadd" }, { "fadd" } },
};

void foo(int i, int j)
{
  const struct dis386 *dp;

  dp = &float_reg[i - 1][j];
}

Note that with &float_reg[i][j] it works just fine.  The fronted generates

  dp = &float_reg + (((long unsigned int) ((long unsigned int) i * 2) + (long
unsigned int) (long unsigned int) j) * 8 + 0xfffffffffffffffffffffffffffffff0);

which has a missing conversion to (struct dis386 *).  Without the
subtraction in the first array ref we get

  dp = (struct dis386 *) &float_reg + ((long unsigned int) ((long unsigned int)
i * 2) + (long unsigned int) (long unsigned int) j) * 8;

instead, which is correct.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|bootstrap                   |c
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-08-20 15:30:51
               date|                            |


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


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

* [Bug c/33122] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
  2007-08-20 13:46 ` [Bug bootstrap/33122] " nickc at redhat dot com
  2007-08-20 15:31 ` [Bug c/33122] " rguenth at gcc dot gnu dot org
@ 2007-08-20 15:40 ` rguenth at gcc dot gnu dot org
  2007-08-20 15:46 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-20 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2007-08-20 15:39 -------
Ah no, this is a bug in fold-const introduced by the pplus merge.  Fix:

@@ -9541,7 +9547,9 @@ fold_binary (enum tree_code code, tree t
          tree arg01 = fold_convert (sizetype, TREE_OPERAND (arg0, 1));
          tree arg00 = TREE_OPERAND (arg0, 0);
          inner = fold_build2 (PLUS_EXPR, sizetype, arg01, fold_convert
(sizetype, arg1));
-         return fold_build2 (POINTER_PLUS_EXPR, type, arg00, inner);
+         return fold_convert (type,
+                              fold_build2 (POINTER_PLUS_EXPR,
+                                           TREE_TYPE (arg00), arg00, inner));
        }

       /* PTR_CST +p CST -> CST1 */


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug c/33122] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
                   ` (2 preceding siblings ...)
  2007-08-20 15:40 ` rguenth at gcc dot gnu dot org
@ 2007-08-20 15:46 ` rguenth at gcc dot gnu dot org
  2007-08-20 15:57 ` [Bug middle-end/33122] [4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-20 15:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-08-20 15:45 -------
Created an attachment (id=14081)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14081&action=view)
patch


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug middle-end/33122] [4.3 Regression] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
                   ` (3 preceding siblings ...)
  2007-08-20 15:46 ` rguenth at gcc dot gnu dot org
@ 2007-08-20 15:57 ` rguenth at gcc dot gnu dot org
  2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
  2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-20 15:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
            Summary|Mistaken type mismatch error|[4.3 Regression] Mistaken
                   |prevents bootstrap          |type mismatch error prevents
                   |                            |bootstrap
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/33122] [4.3 Regression] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
                   ` (4 preceding siblings ...)
  2007-08-20 15:57 ` [Bug middle-end/33122] [4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
  2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-21  8:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-08-21 08:24 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/33122] [4.3 Regression] Mistaken type mismatch error prevents bootstrap
  2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
                   ` (5 preceding siblings ...)
  2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
@ 2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-08-21  8:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2007-08-21 08:24 -------
Subject: Bug 33122

Author: rguenth
Date: Tue Aug 21 08:23:50 2007
New Revision: 127659

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127659
Log:
2007-08-21  Richard Guenther  <rguenther@suse.de>

        PR middle-end/33122
        * fold-const.c (fold_binary): Remove index +p PTR folding.
        Fix types of POINTER_PLUS_EXPR generated by folding of
        (PTR +p B) +p A.

        * gcc.c-torture/compile/pr33122.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr33122.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2007-08-21  8:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-20 13:42 [Bug bootstrap/33122] New: Mistaken type mismatch error prevents bootstrap nickc at redhat dot com
2007-08-20 13:46 ` [Bug bootstrap/33122] " nickc at redhat dot com
2007-08-20 15:31 ` [Bug c/33122] " rguenth at gcc dot gnu dot org
2007-08-20 15:40 ` rguenth at gcc dot gnu dot org
2007-08-20 15:46 ` rguenth at gcc dot gnu dot org
2007-08-20 15:57 ` [Bug middle-end/33122] [4.3 Regression] " rguenth at gcc dot gnu dot org
2007-08-21  8:24 ` rguenth at gcc dot gnu dot org
2007-08-21  8:24 ` rguenth 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).