From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADFA03959C65; Tue, 23 May 2023 08:21:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADFA03959C65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684830060; bh=5XFqR8gyMrv8Y4xSJ5fNgfeKsPNg9XSN7ybbbzjUsIs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=at/4yza44G2ue9MxJq2zPIgXIjWzCSh5qQfEZtRblw35OxYhaLpKI4gZ/vBozu5Tx LdStR4nbxPIMHfIe6J2xraNeKqyOYaxCxXhJd/78mCaLqkemydX/2iNW33Obm0PToY vpBKhoUpwuF5rGMAlAj+S+/s5i/vJXco8CUS1oAw= From: "dev at benjarobin dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109939] Invalid return type for __builtin_arm_ssat: Unsigned instead of signed Date: Tue, 23 May 2023 08:21:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dev at benjarobin dot fr X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109939 --- Comment #2 from Benjamin Robin --- New test case with exactly same problem since __ssat() calls __builtin_arm_ssat(): ``` #include int dbg_ssat_out; int dbg_ssat_in; void test_arm_ssat(void) { dbg_ssat_out =3D __ssat(dbg_ssat_in, 16); } ``` Build command: ``` arm-none-eabi-gcc -mcpu=3Dcortex-m4 -Wall -Wconversion -c t2.c -o t2.o t2.c: In function 'test_arm_ssat': t2.c:8:20: warning: conversion to 'int32_t' {aka 'long int'} from 'unsigned int' may change the sign of the result [-Wsign-conversion] 8 | dbg_ssat_out =3D __ssat(dbg_ssat_in, 16); | ^~~~~~ ```=