public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* grokdeclarator drops type qualifiers when -aux-info isn't asserted?
@ 2009-05-20  9:45 Gary Funck
  2009-05-20 14:22 ` Joseph S. Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Funck @ 2009-05-20  9:45 UTC (permalink / raw)
  To: GCC List

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

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

end of thread, other threads:[~2009-05-20 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-20  9:45 grokdeclarator drops type qualifiers when -aux-info isn't asserted? Gary Funck
2009-05-20 14:22 ` Joseph S. Myers
2009-05-20 21:02   ` Gary Funck

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).