From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EDDE53894E63; Wed, 29 Apr 2020 20:40:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDDE53894E63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588192815; bh=IlLoU4NMWePCohthh9/4vSh7Q2YtJOKu/yu2I9DB3L0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=glV21IC4nwrfxj6wZsicDWlb144UDMx8vU+AjrGRVScjIe+2GKJQivDqdFdyPxZt3 u48EjefPy36+kRO+RnVRwJriT+ExUa+CvtsyeWX/3U7j/K+rLibWBSPk3FbICKTmuq 28lsNkecI82nzBnUdTpfij+S96topdUYytveshiY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94704] [8/9/10 Regression] class with empty base passed incorrectly with -std=c++17 on s390x/s390 Date: Wed, 29 Apr 2020 20:40:15 +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: 10.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: krebbel at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2020 20:40:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94704 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:48e54fea7ba4a7cb7b3d1505951383120220e394 commit r10-8057-g48e54fea7ba4a7cb7b3d1505951383120220e394 Author: Jakub Jelinek Date: Wed Apr 29 22:38:01 2020 +0200 s390: Fix up -Wpsabi diagnostics + [[no_unique_address]] empty member f= ix [PR94704] So, based on the yesterday's discussions, similarly to powerpc64le-linux I've done some testing for s390x-linux too. First of all, I found a bug in my patch from yesterday, it was printing the wrong type like 'double' etc. rather than the class that contained = such the element. Fix below. For s390x-linux, I was using struct X { }; struct Y { int : 0; }; struct Z { int : 0; Y y; }; struct U : public X { X q; }; struct A { double a; }; struct B : public X { double a; }; struct C : public Y { double a; }; struct D : public Z { double a; }; struct E : public U { double a; }; struct F { [[no_unique_address]] X x; double a; }; struct G { [[no_unique_address]] Y y; double a; }; struct H { [[no_unique_address]] Z z; double a; }; struct I { [[no_unique_address]] U u; double a; }; struct J { double a; [[no_unique_address]] X x; }; struct K { double a; [[no_unique_address]] Y y; }; struct L { double a; [[no_unique_address]] Z z; }; struct M { double a; [[no_unique_address]] U u; }; #define T(S, s) extern S s; extern void foo##s (S); int bar##s () { fo= o##s (s); return 0; } T (A, a) T (B, b) T (C, c) T (D, d) T (E, e) T (F, f) T (G, g) T (H, h) T (I, i) T (J, j) T (K, k) T (L, l) T (M, m) as testcase and looking for "\tld\t%f0,". While g++ 9 with -std=3Dc++17 used to pass in fpr just A, g++ 9 -std=3Dc++14, as well as current trunk -std=3Dc++14 & 17 and clang++ from today -std=3Dc++14 & 17 all pass A, B, C in fpr and nothing else. The intent stated by Jason seems to be that A, B, C, F, G, J, K should all be passed in fpr. Attached are two (updated) versions of the patch on top of the powerpc+middle-end patch just posted. The first one emits two separate -Wpsabi warnings like powerpc, one for the -std=3Dc++14 vs. -std=3Dc++17 ABI difference and one for GCC 9 vs. = 10 [[no_unique_address]] passing changes, the other one is silent about the second case. 2020-04-29 Jakub Jelinek PR target/94704 * config/s390/s390.c (s390_function_arg_vector, s390_function_arg_float): Use DECL_FIELD_ABI_IGNORED instead of cxx17_empty_base_field_p. In -Wpsabi diagnostics use the type passed to the function rather than the type of the single eleme= nt. Rename cxx17_empty_base_seen variable to empty_base_seen, change type to int, and adjust diagnostics depending on if the field has [[no_unique_attribute]] or not. * g++.target/s390/s390.exp: New file. * g++.target/s390/pr94704-1.C: New test. * g++.target/s390/pr94704-2.C: New test. * g++.target/s390/pr94704-3.C: New test. * g++.target/s390/pr94704-4.C: New test.=