This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Martin Jambor <mjambor at suse dot cz>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Fri, 27 Sep 2013 10:36:57 +0200
- Subject: Re: [PATCH, PR 57748] Check for out of bounds access, Part 2
- Authentication-results: sourceware.org; auth=none
- References: <20130910193228 dot GE6732 at virgil dot suse> <2318377 dot jMH3S0V0Gd at polaris> <DUB122-W316DE097B96EFBB3FBD1F6E4280 at phx dot gbl>
> Sure, but the modifier is not meant to force something into memory,
> especially when it is already in an register. Remember, we are only
> talking of structures here, and we only want to access one member.
> It is more the other way round:
> It says: "You do not have to load the value in a register, if it is already
> in memory I'm happy"
EXPAND_MEMORY means we are interested in a memory result, even if
the memory is constant and we could have propagated a constant value. */
We definitely want to propagate constant values here, look at the code below.
And it already lists explicit cases where we really need to splill to memory.