[PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-12 Thread Andrew Carlotti via Gcc-patches
aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a function call is null before converting it to an assign statement. To avoid returning an invalid GIMPLE statement in this case, we instead assign the expression result to a new (unused) variable. This change only affects code t

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti wrote: > > aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a > function call is null before converting it to an assign statement. To avoid > returning an invalid GIMPLE statement in this case, we instead assign the > expression r

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > wrote: >> >> aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a >> function call is null before converting it to an assign statement. To avoid >> returning an invalid GIMPLE statement i

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Andrew Carlotti via Gcc-patches
On Wed, Jul 13, 2022 at 09:10:25AM +0100, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > > wrote: > >> > >> aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a > >> function call is null before converting

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 12:50 PM Andrew Carlotti wrote: > > On Wed, Jul 13, 2022 at 09:10:25AM +0100, Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > > On Tue, Jul 12, 2022 at 4:38 PM Andrew Carlotti > > > wrote: > > >> > > >> aarch64_general_gimple_fold_builtin doesn't

Re: [PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-15 Thread Andrew Carlotti via Gcc-patches
On Wed, Jul 13, 2022 at 02:32:16PM +0200, Richard Biener wrote: > On Wed, Jul 13, 2022 at 12:50 PM Andrew Carlotti > wrote: > > I specifically wanted to avoid not folding the call, because always > > folding means that the builtin doesn't need to be implemented anywhere > > else (which isn't relev