[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
@@ -74,7 +74,7 @@ int test13(int *a) { } int test14(int *a, int b) { - a = (int *)__builtin_assume_aligned(b, 32); // expected-error {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *}} + a = (int *)__builtin_assume_aligned(b, 32);

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
@@ -5272,8 +5272,11 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { { ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg); -if (checkBuiltinArgument(*this, TheCall, 0)) ostannard wrote: Done https://github.com/

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-18 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/114217 >From a657d11051c95473727ca5e9f6a8e8ab195fe590 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 30 Oct 2024 12:01:56 + Subject: [PATCH 1/3] [Clang] Fix crash in __builtin_assume_aligned The CodeG

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-16 Thread Eli Friedman via cfe-commits
@@ -5272,8 +5272,11 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { { ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg); -if (checkBuiltinArgument(*this, TheCall, 0)) efriedma-quic wrote: Took another look at

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-12-16 Thread Shafik Yaghmour via cfe-commits
shafik wrote: ping on this we have another regression linked to the original change: https://github.com/llvm/llvm-project/issues/120086 We really should land a fix ASAP, this is now three regression linked to the same change. https://github.com/llvm/llvm-project/pull/114217 _

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Eli Friedman via cfe-commits
@@ -5272,8 +5272,11 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { { ExprResult FirstArgResult = DefaultFunctionArrayLvalueConversion(FirstArg); -if (checkBuiltinArgument(*this, TheCall, 0)) efriedma-quic wrote: checkBuiltinArgument

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -74,7 +74,7 @@ int test13(int *a) { } int test14(int *a, int b) { - a = (int *)__builtin_assume_aligned(b, 32); // expected-error {{incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *}} + a = (int *)__builtin_assume_aligned(b, 32);

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix, I think this makes sense. Please add the tests I commented on and a release note. https://github.com/llvm/llvm-project/pull/114217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Oliver Stannard (ostannard) Changes The CodeGen for __builtin_assume_aligned assumes that the first argument is a pointer, so crashes if the int-conversion error is downgraded or disabled. Emit a non-downgradable error if the argument is

[clang] [Clang] Fix crash in __builtin_assume_aligned (PR #114217)

2024-10-30 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard created https://github.com/llvm/llvm-project/pull/114217 The CodeGen for __builtin_assume_aligned assumes that the first argument is a pointer, so crashes if the int-conversion error is downgraded or disabled. Emit a non-downgradable error if the argument is not a