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]

Re: statement expressions and extended asm bug?


On Thu, 18 Mar 2004, Gunther Nikl wrote:
> On Wed, Mar 17, 2004 at 12:32:32PM -0500, Hans-Peter Nilsson wrote:
> > On Wed, 17 Mar 2004, Gunther Nikl wrote:
> > > On Wed, Mar 17, 2004 at 10:29:54AM -0500, Hans-Peter Nilsson wrote:
> > > > On Tue, 16 Mar 2004, Kai Henningsen wrote:
> > > > > #define f1() \
> > > > > ({ register int _d0 __asm("d0"); \
> > > > >    __asm volatile ("moveq #11,d0" : "=r" (_d0) : /**/ : "fp0", "fp1", "cc",
> > > > > "memory"); \    _d0 + 0; })
> > > > That *should work*.  It it doesn't, it's a bug.
> > >   It doesn't change anything with either 3.3[.3], 3.4 and 3.5.
> > Please file a bug report if you haven't already done so.
>
>   There is no PR yet. I can file one but I need to know why the above
>   (ret + 0) not changing anything is a bug. Its not obvious for me why
>   this is a bug.

If there's a sequence point between the uses of that expression,
then it's a bug.  It there isn't, I'd agree with Nathan(?) that
it's like an assignment to the same variable in the "parallel"
paths.

I forgot now, but didn't you have an example that used two asms
as above where there was a sequence point, yet the asm in one
expression spilled over into the other?

It's no stranger than "func (a++, a++)" being undefined.

>   FYI, I tried a non-zero add just as test and then it did work.
>
>   BTW, what about this?
>
>     if (f1() == f2())

That's not a sequence point, right?

brgds, H-P


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