On Mon, Nov 18, 2013 at 3:24 PM, Jeff Law wrote:
> On 11/18/13 04:08, Richard Biener wrote:
>>>
>>> I'd say that turning memset (0, '\0', 0) into a trap is bad from a QOI
>>
>> perspective. Jeff, is there an easy way to avoid this? Testcase:
>>
>> void fn (void *addr, int a)
>> {
>>if (a ==
On Mon, Nov 18, 2013 at 07:24:46AM -0700, Jeff Law wrote:
> On 11/18/13 04:08, Richard Biener wrote:
> >>I'd say that turning memset (0, '\0', 0) into a trap is bad from a QOI
> >perspective. Jeff, is there an easy way to avoid this? Testcase:
> >
> >void fn (void *addr, int a)
> >{
> > if (a =
On 11/18/13 04:08, Richard Biener wrote:
I'd say that turning memset (0, '\0', 0) into a trap is bad from a QOI
perspective. Jeff, is there an easy way to avoid this? Testcase:
void fn (void *addr, int a)
{
if (a == 0)
addr = (void *)0;
__builtin_memset (addr, '\0', a);
}
I wonder
On Mon, Nov 18, 2013 at 12:08:27PM +0100, Richard Biener wrote:
> I'd say that turning memset (0, '\0', 0) into a trap is bad from a QOI
> perspective. Jeff, is there an easy way to avoid this? Testcase:
>
> void fn (void *addr, int a)
> {
> if (a == 0)
> addr = (void *)0;
> __builtin_me
On Mon, Nov 18, 2013 at 8:11 AM, Florian Weimer wrote:
> * Jeff Law:
>
>>> Is this new in C11? Does it apply to functions such as strnlen as well?
>
>> No, it's C99 I think. There was a clarification which came in after
>> C99 which clarified that even if the length is zero, the pointers must
>>
* Jeff Law:
>> Is this new in C11? Does it apply to functions such as strnlen as well?
> No, it's C99 I think. There was a clarification which came in after
> C99 which clarified that even if the length is zero, the pointers must
> still be valid.
Okay, I found the language in sections 7.1.4 a
On 11/17/13 15:02, Florian Weimer wrote:
* Jonathan Wakely:
On 17 November 2013 18:25, Dominic News wrote:
In the following code (from xorg-server)
if (a == 0)
addr = 0;
(...)
memset(addr, '\0', a);
the path for a==0 is turned into a trap by -fisolate-erroneous-paths.
On Sun, 17 Nov 2013, Florian Weimer wrote:
* Jonathan Wakely:
On 17 November 2013 18:25, Dominic News wrote:
In the following code (from xorg-server)
if (a == 0)
addr = 0;
(...)
memset(addr, '\0', a);
the path for a==0 is turned into a trap by -fisolate-erroneous-paths.
* Jonathan Wakely:
> On 17 November 2013 18:25, Dominic News wrote:
>> In the following code (from xorg-server)
>>
>> if (a == 0)
>> addr = 0;
>> (...)
>> memset(addr, '\0', a);
>>
>> the path for a==0 is turned into a trap by -fisolate-erroneous-paths. (Is
>> calling memset li
On 17 November 2013 18:25, Dominic News wrote:
> In the following code (from xorg-server)
>
> if (a == 0)
> addr = 0;
> (...)
> memset(addr, '\0', a);
>
> the path for a==0 is turned into a trap by -fisolate-erroneous-paths. (Is
> calling memset like this undefined behaviour?)
In the following code (from xorg-server)
if (a == 0)
addr = 0;
(...)
memset(addr, '\0', a);
the path for a==0 is turned into a trap by -fisolate-erroneous-paths. (Is
calling memset like this undefined behaviour?)
Is it intentional that essentially a noop is turned into a trap?
11 matches
Mail list logo