Re: [PATCH] Fix questionable optimization of short-circuit operators

2025-06-11 Thread Eric Botcazou
> While you are at it > > if ((code2 == BIT_AND_EXPR > - && TYPE_PRECISION (TREE_TYPE (op0)) == 1 >&& TREE_CODE (gimple_assign_rhs2 (second)) != > INTEGER_CST) > || code2 == TRUTH_AND_EXPR) > > code2 can never be TRUTH_AND_EXPR

Re: [PATCH] Fix questionable optimization of short-circuit operators

2025-06-10 Thread Richard Biener
On Tue, Jun 10, 2025 at 10:47 AM Eric Botcazou wrote: > > Hi, > > the compiler can swap the operands of the short-circuit operators in some > cases, which can be problematic for tools like Valgrind that detect uses of > uninitialized data, and is probably counterproductive in most cases. > > The c

[PATCH] Fix questionable optimization of short-circuit operators

2025-06-10 Thread Eric Botcazou
Hi, the compiler can swap the operands of the short-circuit operators in some cases, which can be problematic for tools like Valgrind that detect uses of uninitialized data, and is probably counterproductive in most cases. The change prevents this from occurring, but also extends the use of jum