This is the mail archive of the gcc-patches@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]

Re: Patch to add "pure" attribute to some functions


 > From: Jan Hubicka <jhub6202@ss1000.ms.mff.cuni.cz>
 > 
 > > Hi,
 > > 
 > > 	I don't think your detection for ATTRIBUTE_PURE will work when
 > > someone bootstraps stage1 with a 2.96 snapshot from before when your
 > > patch is installed.
 > 
 > I wondered about this problem when i was writing the code. I've tested
 > it and the compiler just complained about ignored attribute so I've
 > decided that this is probably OK (the stage 1 will warn a lot but once you
 > bootstrap problem disappears and 2.96 snapshots are development so they
 > may not get to normal user not aware of this.)

	Ah, it occurs to me that our two cases are slightly different.

In my case, I was adding attribute unused on labels where no
attributes were previously allowed.  I had to first change the parser
to allow any attributes on labels at all.  Otherwise snapshots without
this change got a syntax error if they saw one.

Since functions already allow some attributes, and gcc only warns
about the unknown attribute pure, perhaps you don't need to do
anything.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


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