On Thu, 2013-12-05 17:16:53 +0800, Bin.Cheng <amker.ch...@gmail.com> wrote:
> On Thu, Dec 5, 2013 at 6:57 AM, Joseph S. Myers <jos...@codesourcery.com> 
> wrote:
> > Index: c-family/c-common.c
> > ===================================================================
> > --- c-family/c-common.c (revision 205668)
> > +++ c-family/c-common.c (working copy)
> > @@ -4921,14 +4921,17 @@ c_common_get_alias_set (tree t)
> >  }
> >
> >  /* Compute the value of 'sizeof (TYPE)' or '__alignof__ (TYPE)', where
> > -   the second parameter indicates which OPERATOR is being applied.
> > +   the IS_SIZEOF parameter indicates which operator is being applied.
> >     The COMPLAIN flag controls whether we should diagnose possibly
> >     ill-formed constructs or not.  LOC is the location of the SIZEOF or
> > -   TYPEOF operator.  */
> > +   TYPEOF operator.  If MIN_ALIGNOF, the least alignment required for
> > +   a type in any context should be returned, rather than the normal
> > +   alignment for that type.  */
> >
> >  tree
> >  c_sizeof_or_alignof_type (location_t loc,
> > -                         tree type, bool is_sizeof, int complain)
> > +                         tree type, bool is_sizeof, bool min_alignof,
> > +                         int complain)
> >  {
> >    const char *op_name;
> >    tree value = NULL;
> > @@ -4994,6 +4997,22 @@ c_sizeof_or_alignof_type (location_t loc,
> >         value = size_binop_loc (loc, CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
> >                                 size_int (TYPE_PRECISION (char_type_node)
> >                                           / BITS_PER_UNIT));
> > +      else if (min_alignof)
> > +       {
> > +         unsigned int align = TYPE_ALIGN (type);
> > +         align = MIN (align, BIGGEST_ALIGNMENT);
> > +#ifdef BIGGEST_FIELD_ALIGNMENT
> > +         align = MIN (align, BIGGEST_FIELD_ALIGNMENT);
> > +#endif
> > +         tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE,
> > +                                  type);
> > +         unsigned int field_align = align;
> > +#ifdef ADJUST_FIELD_ALIGN
> > +         field_align = ADJUST_FIELD_ALIGN (field, field_align);
> > +#endif
> 
> Won't *field* be unused if ADJUST_FIELD_ALIGN not defined?

You're right:

g++ -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  
-DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti 
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings 
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long 
-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  
-DHAVE_CONFIG_H -I. -Ic-family -I../../../gcc/gcc -I../../../gcc/gcc/c-family 
-I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include 
-I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber 
-I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
-I../../../gcc/gcc/../libbacktrace    -o c-family/c-common.o -MT 
c-family/c-common.o -MMD -MP -MF c-family/.deps/c-common.TPo 
../../../gcc/gcc/c-family/c-common.c
../../../gcc/gcc/c-family/c-common.c: In function ‘tree_node* 
c_sizeof_or_alignof_type(location_t, tree, bool, bool, int)’:
../../../gcc/gcc/c-family/c-common.c:5007:9: error: unused variable ‘field’ 
[-Werror=unused-variable]
    tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE,
         ^
cc1plus: all warnings being treated as errors
make[2]: *** [c-family/c-common.o] Error 1

This is m68k-elf, see eg.
http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=50551 ,
but other targets are also affected.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbg...@lug-owl.de              +49-172-7608481
Signature of: They that give up essential liberty to obtain temporary safety,
the second  : deserve neither liberty nor safety.  (Ben Franklin)

Attachment: signature.asc
Description: Digital signature

Reply via email to