This is the mail archive of the 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: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

On Thu, 2 Oct 2014, David Wohlferd wrote:
> > You want
> >
> > "=m" (*( struct foo  { char x[8]; } __attribute__((may_alias)) *)Dest)
> Thank you.  With your help, that worse-than-useless sample in the docs
> is getting closer to something people can actually use.

Thank *you* for your investigation.

> While I really like the idea of using memory constraints to avoid all
> out memory clobbers, 16 bytes is a pretty small maximum memory block,
> and x32 only supports a max of 8.  Unless there's some way to use larger
> sizes (say SSIZE_MAX), this feature hardly seems worth documenting.

Exactly.  Now, with it documented and all, we're (should be) on
the hook to actually maintain that...feature, so we don't break
it now that the tweaked version works.  The best practice is a
test-case in the test-suite.  With all the required tweaks I
presume we don't have one.  It seems grepping a gimple dump
works, with a scan-dump-based test (numerous examples; framework
is in place).  Could you please consider adding one?

(Or a patch to remove the feature from the docs since it hasn't
had the intended effect for some long time - my not-so-secret
actual point...)

brgds, H-P

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