This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

grokdeclarator drops type qualifiers when -aux-info isn't asserted?


Recently, I was debugging an issue in the GCC/UPC front-end
that related to some problems compiling specific UPC type
declarations.  The front-end was, in certain cases, dropping
UPC's "shared" qualifier.

The relevant code is in grokdeclarator:

  if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
      type = TYPE_MAIN_VARIANT (type);

Above, if the -aux-info switch isn't asserted
then the type is set to its main variant.

The -aux-info switch does the following:

`-aux-info FILENAME'
     Output to the given filename prototyped declarations for all
     functions declared and/or defined in a translation unit, including
     those in header files.  This option is silently ignored in any
     language other than C. [...]

Given that this switch enables the generation of a report,
it is surprising that this switch would cause the front-end
to work differently depending upon whether -aux-info is asserted or not.

That aside, I wonder if it is an error to drop the qualifiers
as shown above?  In the case of UPC, for example, dropping qualifiers
definitely leads to problems; it may be the case that UPC's
logic has to be reworked a bit if, in fact, the TYPE_MAIN_VARIANT()
call above is needed.

thanks,
- Gary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]