Message ID | 8dd8a6ab-24ca-9c59-1b3b-5fdca48896fa@suse.cz |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABAF33858027 for <patchwork@sourceware.org>; Tue, 19 Oct 2021 09:17:09 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 692183858D39 for <gcc-patches@gcc.gnu.org>; Tue, 19 Oct 2021 09:16:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 692183858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 622C31FC9E for <gcc-patches@gcc.gnu.org>; Tue, 19 Oct 2021 09:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634635012; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XI8yBMeIVN8O6nJYBNsQY2Q8Ru7PYJzQEaTC8o7HtXI=; b=KRf0RDWQ5SbB7N/NZX7tPds+3Rykr5YD5KAuBbACmtgs1wicD/5838mwN4gomXMPVZL7CD x4ABY7RHF5xGhywjrR/pJl3WTdRHXSacgi3y/1p31dqvtkhgItBpK8yxSwecUPconowIju aZSdIsY/FfYg+2/tAm6z5YdPa76sgF8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634635012; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XI8yBMeIVN8O6nJYBNsQY2Q8Ru7PYJzQEaTC8o7HtXI=; b=y+xOzzVxiHnjKJ9u0zfy9aojEW7xSpFJY4BV350TLhpSaOSvvBWRNaNOPQ7ClAZo3CDL80 gpo+ajVD/nfRK2Bw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 53AAC13FE1 for <gcc-patches@gcc.gnu.org>; Tue, 19 Oct 2021 09:16:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0JA4EwSNbmHoJgAAMHmgww (envelope-from <mliska@suse.cz>) for <gcc-patches@gcc.gnu.org>; Tue, 19 Oct 2021 09:16:52 +0000 Message-ID: <8dd8a6ab-24ca-9c59-1b3b-5fdca48896fa@suse.cz> Date: Tue, 19 Oct 2021 11:16:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= <mliska@suse.cz> Subject: [PATCH][aarch64] target: Support whitespaces in target attr/pragma. To: gcc-patches@gcc.gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[aarch64] target: Support whitespaces in target attr/pragma.
|
|
Commit Message
Martin Liška
Oct. 19, 2021, 9:16 a.m. UTC
Hello. The patch does the same as g:df592811f950301ed3b10a08e476dad0f2eff26a for aarch64. Tested locally with cross compiler. Ready for master? Thanks, Martin PR target/102375 gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_process_one_target_attr): Strip whitespaces. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr102375.c: New test. --- gcc/config/aarch64/aarch64.c | 1 + gcc/testsuite/gcc.target/aarch64/pr102375.c | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr102375.c
Comments
Martin Liška <mliska@suse.cz> writes: > Hello. > > The patch does the same as g:df592811f950301ed3b10a08e476dad0f2eff26a for aarch64. > > Tested locally with cross compiler. > > Ready for master? > > Thanks, > Martin > > PR target/102375 > > gcc/ChangeLog: > > * config/aarch64/aarch64.c (aarch64_process_one_target_attr): > Strip whitespaces. > > gcc/testsuite/ChangeLog: > > * gcc.target/aarch64/pr102375.c: New test. > --- > gcc/config/aarch64/aarch64.c | 1 + > gcc/testsuite/gcc.target/aarch64/pr102375.c | 4 ++++ > 2 files changed, 5 insertions(+) > create mode 100644 gcc/testsuite/gcc.target/aarch64/pr102375.c > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index 76d99d247ae..4c3e491ab14 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -17624,6 +17624,7 @@ aarch64_process_one_target_attr (char *arg_str) > bool invert = false; > > size_t len = strlen (arg_str); > + arg_str = strip_whitespaces (arg_str, &len); It looks like this ought to happen after the alloca and copy, since it modifies the string. Thanks, Richard > > if (len == 0) > { > diff --git a/gcc/testsuite/gcc.target/aarch64/pr102375.c b/gcc/testsuite/gcc.target/aarch64/pr102375.c > new file mode 100644 > index 00000000000..fa75d319b2d > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/pr102375.c > @@ -0,0 +1,4 @@ > +/* PR target/102375 */ > +/* { dg-do compile } */ > + > +void calculate(void) __attribute__ ((target ("+sve, +sve2")));
On 10/19/21 12:52, Richard Sandiford wrote: > It looks like this ought to happen after the alloca and copy, since it > modifies the string. Oh yeah, good point. Ready to be installed with the change? Thanks, Martin
Martin Liška <mliska@suse.cz> writes: > On 10/19/21 12:52, Richard Sandiford wrote: >> It looks like this ought to happen after the alloca and copy, since it >> modifies the string. > > Oh yeah, good point. > > Ready to be installed with the change? > Thanks, > Martin > > From 68df4cba3bccb714a14e3c795e6d9e4a44c54318 Mon Sep 17 00:00:00 2001 > From: Martin Liska <mliska@suse.cz> > Date: Tue, 19 Oct 2021 11:11:16 +0200 > Subject: [PATCH] target: Support whitespaces in target attr/pragma. > > PR target/102375 > > gcc/ChangeLog: > > * config/aarch64/aarch64.c (aarch64_process_one_target_attr): > Strip whitespaces. > > gcc/testsuite/ChangeLog: > > * gcc.target/aarch64/pr102375.c: New test. OK, thanks. Richard > --- > gcc/config/aarch64/aarch64.c | 1 + > gcc/testsuite/gcc.target/aarch64/pr102375.c | 4 ++++ > 2 files changed, 5 insertions(+) > create mode 100644 gcc/testsuite/gcc.target/aarch64/pr102375.c > > diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c > index 76d99d247ae..fdf341812f4 100644 > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -17633,6 +17633,7 @@ aarch64_process_one_target_attr (char *arg_str) > > char *str_to_check = (char *) alloca (len + 1); > strcpy (str_to_check, arg_str); > + str_to_check = strip_whitespaces (str_to_check, &len); > > /* We have something like __attribute__ ((target ("+fp+nosimd"))). > It is easier to detect and handle it explicitly here rather than going > diff --git a/gcc/testsuite/gcc.target/aarch64/pr102375.c b/gcc/testsuite/gcc.target/aarch64/pr102375.c > new file mode 100644 > index 00000000000..fa75d319b2d > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/pr102375.c > @@ -0,0 +1,4 @@ > +/* PR target/102375 */ > +/* { dg-do compile } */ > + > +void calculate(void) __attribute__ ((target ("+sve, +sve2")));
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 76d99d247ae..4c3e491ab14 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -17624,6 +17624,7 @@ aarch64_process_one_target_attr (char *arg_str) bool invert = false; size_t len = strlen (arg_str); + arg_str = strip_whitespaces (arg_str, &len); if (len == 0) { diff --git a/gcc/testsuite/gcc.target/aarch64/pr102375.c b/gcc/testsuite/gcc.target/aarch64/pr102375.c new file mode 100644 index 00000000000..fa75d319b2d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr102375.c @@ -0,0 +1,4 @@ +/* PR target/102375 */ +/* { dg-do compile } */ + +void calculate(void) __attribute__ ((target ("+sve, +sve2")));