Bug 50386 - [4.7 Regression] libgomp.h:87:5: error: unnamed struct/union that defines no instances
Summary: [4.7 Regression] libgomp.h:87:5: error: unnamed struct/union that defines no ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 19:27 UTC by John David Anglin
Modified: 2011-10-19 08:46 UTC (History)
2 users (show)

See Also:
Host: armv5tejl-unknown-linux-gnueabi
Target: armv5tejl-unknown-linux-gnueabi
Build: armv5tejl-unknown-linux-gnueabi
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2011-09-13 19:27:11 UTC
libtool: compile:  /home/dave/gnu/gcc/objdir/./gcc/xgcc -B/home/dave/gnu/gcc/obj
dir/./gcc/ -B/home/dave/opt/gnu/gcc/gcc-4.7/armv5tejl-unknown-linux-gnueabi/bin/
 -B/home/dave/opt/gnu/gcc/gcc-4.7/armv5tejl-unknown-linux-gnueabi/lib/ -isystem
/home/dave/opt/gnu/gcc/gcc-4.7/armv5tejl-unknown-linux-gnueabi/include -isystem
/home/dave/opt/gnu/gcc/gcc-4.7/armv5tejl-unknown-linux-gnueabi/sys-include -DHAV
E_CONFIG_H -I. -I../../../gcc/libgomp -I../../../gcc/libgomp/config/linux/arm -I
../../../gcc/libgomp/config/linux -I../../../gcc/libgomp/config/posix -I../../..
/gcc/libgomp -Wall -Werror -pthread -ftls-model=initial-exec -g -O2 -MT alloc.lo
 -MD -MP -MF .deps/alloc.Tpo -c ../../../gcc/libgomp/alloc.c  -fPIC -DPIC -o .li
bs/alloc.o
In file included from ../../../gcc/libgomp/alloc.c:29:0:
../../../gcc/libgomp/libgomp.h:87:5: error: unnamed struct/union that defines no
 instances [-Werror]
../../../gcc/libgomp/libgomp.h:94:5: error: unnamed struct/union that defines no
 instances [-Werror]
../../../gcc/libgomp/libgomp.h:95:3: error: unnamed struct/union that defines no
 instances [-Werror]
../../../gcc/libgomp/libgomp.h:146:3: error: unnamed struct/union that defines n
o instances [-Werror]
../../../gcc/libgomp/libgomp.h:156:3: error: unnamed struct/union that defines no instances [-Werror]
../../../gcc/libgomp/libgomp.h: In function 'gomp_work_share_init_done':
../../../gcc/libgomp/libgomp.h: In function 'gomp_work_share_init_done':
../../../gcc/libgomp/libgomp.h:502:47: error: 'struct gomp_work_share' has no member named 'next_ws'
cc1: all warnings being treated as errors

Occurs in stage2 with

-bash-3.2$ ./xgcc -B./ -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: armv5tejl-unknown-linux-gnueabi
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,objc,obj-c++ --enable-checking=release --enable-shared --enable-threads --disable-multilib --disable-libmudflap --disable-libssp --enable-symvers=gnu --enable-__cxa_atexit --disable-libstdcxx-pch --prefix=/home/dave/opt/gnu/gcc/gcc-4.7 --with-gmp=/home/dave/opt/gnu --with-as=/home/dave/opt/gnu/bin/as --with-ld=/home/dave/opt/gnu/bin/ld
Thread model: posix
gcc version 4.7.0 20110912 (experimental) [trunk revision 178782] (GCC)
Comment 1 John David Anglin 2011-09-16 18:07:40 UTC
Warning doesn't occur with gcc version 4.4.7 20110530.

There is something arm specific in these warnings as they don't
occur on PA.
Comment 2 Ramana Radhakrishnan 2011-09-20 10:49:02 UTC
Do you have some date before when trunk managed bootstraps successfully ? 

Ramana
Comment 3 dave.anglin 2011-09-20 13:46:04 UTC
On 9/20/2011 6:49 AM, ramana at gcc dot gnu.org wrote:
> Do you have some date before when trunk managed bootstraps successfully ?
>

This is my last successful build:
http://gcc.gnu.org/ml/gcc-testresults/2011-09/msg00879.html

Dave
Comment 4 Ramana Radhakrishnan 2011-09-20 22:32:49 UTC
I think this is a bootstrap issue rather than a problem with libgomp . A reduced testcase of this form fails with the stage2 compiler but is ok with the stage1 compiler. 


struct gomp_work_share
{
  /* This member records the SCHEDULE clause to be used for this construct.
     The user specification of "runtime" will already have been resolved.
     If this is a SECTIONS construct, this value will always be DYNAMIC.  */
  union {
    struct {
      /* This is the chunk_size argument to the SCHEDULE clause.  */
      long chunk_size;

      /* This is the iteration end point.  If this is a SECTIONS construct,
         this is the number of contained sections.  */
      long end;

      /* This is the iteration step.  If this is a SECTIONS construct, this
         is always 1.  */
      long incr;
    }u;

  };
}a;

Where the stage2 compiler goes : 

/home/40000/t1.i:21:3: warning: unnamed struct/union that defines no instances [enabled by default]


and the stage1 compiler goes quietly. 

Could you check if you see similar behaviour ? 

Ramana
Comment 5 dave.anglin 2011-09-23 16:04:18 UTC
On 9/20/2011 6:32 PM, ramana at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50386
>
> --- Comment #4 from Ramana Radhakrishnan<ramana at gcc dot gnu.org>  2011-09-20 22:32:49 UTC ---
> I think this is a bootstrap issue rather than a problem with libgomp . A
> reduced testcase of this form fails with the stage2 compiler but is ok with the
> stage1 compiler.
>
>
> struct gomp_work_share
> {
>    /* This member records the SCHEDULE clause to be used for this construct.
>       The user specification of "runtime" will already have been resolved.
>       If this is a SECTIONS construct, this value will always be DYNAMIC.  */
>    union {
>      struct {
>        /* This is the chunk_size argument to the SCHEDULE clause.  */
>        long chunk_size;
>
>        /* This is the iteration end point.  If this is a SECTIONS construct,
>           this is the number of contained sections.  */
>        long end;
>
>        /* This is the iteration step.  If this is a SECTIONS construct, this
>           is always 1.  */
>        long incr;
>      }u;
>
>    };
> }a;
>
> Where the stage2 compiler goes :
>
> /home/40000/t1.i:21:3: warning: unnamed struct/union that defines no instances
> [enabled by default]
>
>
> and the stage1 compiler goes quietly.
>
> Could you check if you see similar behaviour ?
>
Yes, exactly.  I noted in my original report that the error occurred in 
stage2.

While not fully confirmed, it looks like this was introduced by r178692.

Dave
Comment 6 Richard Sandiford 2011-09-27 13:54:14 UTC
Seems to be the same PR50326.  Testing a fix.
Comment 7 Richard Sandiford 2011-09-27 17:18:29 UTC
Author: rsandifo
Date: Tue Sep 27 17:18:22 2011
New Revision: 179285

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179285
Log:
gcc/
	PR middle-end/50386
	PR middle-end/50326
	* tree-sra.c (build_ref_for_model): Use the type of the field as
	the type of the COMPONENT_REF.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-sra.c
Comment 8 Richard Biener 2011-09-29 13:15:17 UTC
Fixed.
Comment 9 Jakub Jelinek 2011-10-19 08:46:12 UTC
Author: jakub
Date: Wed Oct 19 08:45:45 2011
New Revision: 180179

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180179
Log:
	PR target/50350
	Backport from mainline
	2011-09-27  Richard Sandiford  <rdsandiford@googlemail.com>

	PR middle-end/50386
	PR middle-end/50326
	* tree-sra.c (build_ref_for_model): Use the type of the field as
	the type of the COMPONENT_REF.

Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/tree-sra.c