public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/39983]  New: ICE: type mismatch in address expression
@ 2009-04-30 21:06 dimhen at gmail dot com
  2009-05-01 19:57 ` [Bug middle-end/39983] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dimhen at gmail dot com @ 2009-04-30 21:06 UTC (permalink / raw)
  To: gcc-bugs

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

gcc-trunk rev.147009 with command-line 
gcc -O -c tst7.c

fail to compile

typedef struct {
    int *p;
} *A;

extern const int a[1];
extern const int b[1];

void foo()
{
    A x;
    A y;
    static const int * const c[] = { b };

    x->p = (int*)c[0];
    y->p = (int*)a;
}

with message:

tst7.c: In function ‘foo’:
tst7.c:16: error: type mismatch in address expression
int *

const int[1] *

# .MEM_5 = VDEF <.MEM_4(D)>
x_2(D)->p = &b;

tst7.c:16: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[root@localhost gcc_err]# gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc_current/configure --prefix=/usr/local/gcc_current
--enable-bootstrap --enable-shared --enable-checking=yes --with-system-zlib
--enable-__cxa_atexit --enable-languages=c,c++
--enable-version-specific-runtime-libs : (reconfigured)
../gcc_current/configure --prefix=/usr/local/gcc_current --enable-bootstrap
--enable-shared --enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-languages=c,c++ --enable-version-specific-runtime-libs :
(reconfigured) ../gcc_current/configure --prefix=/usr/local/gcc_current
--enable-bootstrap --enable-shared --enable-checking=yes --with-system-zlib
--enable-__cxa_atexit --enable-version-specific-runtime-libs
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../gcc_current/configure --prefix=/usr/local/gcc_current --enable-bootstrap
--enable-shared --enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion : (reconfigured) ../gcc_current/configure
--prefix=/usr/local/gcc_current --enable-bootstrap --enable-shared
--enable-checking=yes --with-system-zlib --enable-__cxa_atexit
--enable-version-specific-runtime-libs --enable-languages=c,c++ --no-create
--no-recursion
Thread model: posix
gcc version 4.5.0 20090430 (experimental) [trunk revision 147009] (GCC)


-- 
           Summary: ICE: type mismatch in address expression
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dimhen at gmail dot com
 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=39983


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

* [Bug middle-end/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
@ 2009-05-01 19:57 ` rguenth at gcc dot gnu dot org
  2009-05-01 21:13 ` [Bug c/39983] " rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-01 19:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-05-01 19:56 -------
Mine.


-- 

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|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-01 19:56:53
               date|                            |


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


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

* [Bug c/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
  2009-05-01 19:57 ` [Bug middle-end/39983] " rguenth at gcc dot gnu dot org
@ 2009-05-01 21:13 ` rguenth at gcc dot gnu dot org
  2009-05-02 17:55 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-01 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-05-01 21:13 -------
FE problem.  In

  extern const int b[1];
  static const int * const c[] = { b };

b decays to type int * instead of const int *.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug c/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
  2009-05-01 19:57 ` [Bug middle-end/39983] " rguenth at gcc dot gnu dot org
  2009-05-01 21:13 ` [Bug c/39983] " rguenth at gcc dot gnu dot org
@ 2009-05-02 17:55 ` rguenth at gcc dot gnu dot org
  2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-02 17:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-05-02 17:55 -------
Hm, it's rather that the fix for &a vs. &a[0] doesn't apply to constructor
elements.  *sigh*

Re-visiting the "real" fix.


-- 


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


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

* [Bug c/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
                   ` (3 preceding siblings ...)
  2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
  2009-05-06 17:48 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2009-05-03 19:57 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


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


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

* [Bug c/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
                   ` (2 preceding siblings ...)
  2009-05-02 17:55 ` rguenth at gcc dot gnu dot org
@ 2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
  2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
  2009-05-06 17:48 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-03 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-05-03 19:57 -------
Subject: Bug 39983

Author: rguenth
Date: Sun May  3 19:57:32 2009
New Revision: 147083

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147083
Log:
2009-05-03  Richard Guenther  <rguenther@suse.de>

        PR c/39983
        * c-typeck.c (array_to_pointer_conversion): Do not built
        ADDR_EXPRs of arrays of pointer-to-element type.
        * c-gimplify.c (c_gimplify_expr): Revert change fixing
        up wrong ADDR_EXPRs after-the-fact.
        * c-common.c (strict_aliasing_warning): Strip pointer
        conversions for obtaining the original type.
        * builtins.c (fold_builtin_memset): Handle array types.
        (fold_builtin_memory_op): Handle folded POINTER_PLUS_EXPRs
        and array types

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

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr39983.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/c-common.c
    trunk/gcc/c-gimplify.c
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/39983] ICE: type mismatch in address expression
  2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
                   ` (4 preceding siblings ...)
  2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
@ 2009-05-06 17:48 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-05-06 17:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at gcc dot gnu dot org  2009-05-06 17:47 -------
Subject: Bug 39983

Author: hjl
Date: Wed May  6 17:45:40 2009
New Revision: 147195

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147195
Log:
2009-05-06  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2009-05-06  H.J. Lu  <hongjiu.lu@intel.com>

        PR middle-end/40021
        * gfortran.fortran-torture/execute/pr40021.f: New.

        2009-05-05  Richard Guenther  <rguenther@suse.de>

        PR middle-end/40023
        * gcc.c-torture/compile/pr40023.c: New testcase.

        2009-05-03  Richard Guenther  <rguenther@suse.de>

        PR c/39983
        * gcc.c-torture/compile/pr39983.c: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr39983.c
      - copied unchanged from r147193,
trunk/gcc/testsuite/gcc.c-torture/compile/pr39983.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40023.c
      - copied unchanged from r147194,
trunk/gcc/testsuite/gcc.c-torture/compile/pr40023.c
   
branches/gcc-4_4-branch/gcc/testsuite/gfortran.fortran-torture/execute/pr40021.f
      - copied unchanged from r147193,
trunk/gcc/testsuite/gfortran.fortran-torture/execute/pr40021.f
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2009-05-06 17:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 21:06 [Bug middle-end/39983] New: ICE: type mismatch in address expression dimhen at gmail dot com
2009-05-01 19:57 ` [Bug middle-end/39983] " rguenth at gcc dot gnu dot org
2009-05-01 21:13 ` [Bug c/39983] " rguenth at gcc dot gnu dot org
2009-05-02 17:55 ` rguenth at gcc dot gnu dot org
2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
2009-05-03 19:58 ` rguenth at gcc dot gnu dot org
2009-05-06 17:48 ` hjl 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).