[PATCH try 2 resend] [i386] Remove warnings for ignoring -mcall-ms2sysv-xlogues.

2017-06-11 Thread Daniel Santos
if the function calls __buildin_eh_return. Some of these cases can likely be supported, but they are just on the "not yet tested" list. 2017-06-11 Daniel Santos --- gcc/config/i386/i386.c | 26 +++--- gcc/doc/invoke.texi| 25 - 2 files chan

Re: [PATCH v2 0/2] [testsuite, libgcc] PR80759 Fix FAILs on Solaris and Darwin

2017-07-01 Thread Daniel Santos
+- 11 files changed, 274 insertions(+), 269 deletions(-) Many thanks to Rainer for all of his help on this! Thanks, Daniel 2017-06-28 Daniel Santos 2017-06-10 Daniel Santos PR testsuite/80759 * gcc.target/x86_64/abi/ms-sysv/do-test.S (ELFFN_BEGIN): Rename to

[PATCH 1/2] [testsuite] PR80759 fix tests on Solaris and Darwin

2017-07-01 Thread Daniel Santos
uted around 20k individual tests. This high number resulted in test jobs far exceeding the default 5 minute timeout for remote_/local_exec when gcc was built with --enable-checking=rtl. This has been resolved by splitting the tests out to a maximum of around 3500 tests per job. Signed-off-by

[PATCH 2/2] [libgcc]: PR80759 fixes for Solaris & Darwin

2017-07-01 Thread Daniel Santos
s stubs on Solaris and Darwin. * Replace .macro/.endm with cpp macros * Replace .global with .globl * Append __USER_LABEL_PREFIX__ when defined (via ASMNAME macro). * Only use .size when __ELF__ is defined. * Only use .hidden when both __ELF__ and HAVE_GAS_HIDDEN are defined. Signed-off-by: Dan

Re: [PATCH] Fix ms-sysv.exp testsuite FAILs (PR c/83117)

2017-11-27 Thread Daniel Santos
On 11/27/2017 04:34 PM, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, my C FE rvalue folding patch allows folding > const variable initializers into the uses of those variables in rvalue > contexts more than before, and so we get warnings about UB in the test, > because an unprototyped fun

Re: [PATCH] Fix ms-sysv.exp testsuite FAILs (PR c/83117)

2017-11-28 Thread Daniel Santos
On 11/28/2017 05:22 AM, Jakub Jelinek wrote: > On Mon, Nov 27, 2017 at 05:02:32PM -0600, Daniel Santos wrote: >>> --- gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/gen.cc.jj 2017-05-22 >>> 10:49:45.0 +0200 >>> +++ gcc/testsuite/gcc.target/x86_64/abi/

[PATCH, x86, libgcc] PR target/83917 Correct debug for -mcall-ms2sysv-xlogues stubs

2018-01-19 Thread Daniel Santos
feedback. I've reg-tested on x86_64, but I still need to test on Solaris and Darwin. OK to commit after those tests? Thanks, Daniel Signed-off-by: Daniel Santos --- libgcc/config/i386/resms64fx.h | 19 +++ libgcc/config/i386/resms64x.h | 22 ++ 2 files change

Re: [PATCH, x86, libgcc] PR target/83917 Correct debug for -mcall-ms2sysv-xlogues stubs

2018-01-20 Thread Daniel Santos
On 01/19/2018 05:35 PM, Jakub Jelinek wrote: > On Fri, Jan 19, 2018 at 05:33:10PM -0600, Daniel Santos wrote: >> When stepping through tail-call restore stubs the debugger has to assume >> that rsp - 8 is the CFA, although it is not. This is because I did not >> explicitly ad

Re: [PATCH] Correct debug for -mcall-ms2sysv-xlogues stubs (PR target/83917, take 2)

2018-02-25 Thread Daniel Santos
I do have one correction though. On 02/22/2018 08:56 AM, Jakub Jelinek wrote: > Hi! > > On Sat, Jan 20, 2018 at 06:01:16PM -0600, Daniel Santos wrote: >> Thanks.  I like the idea of commonizing the macros for consistency. > Didn't see a progress on this P3 for a while, so I&

Re: [PATCH] Correct debug for -mcall-ms2sysv-xlogues stubs (PR target/83917, take 2)

2018-02-26 Thread Daniel Santos
On 02/26/2018 02:20 AM, Jakub Jelinek wrote: > On Sun, Feb 25, 2018 at 05:56:28PM -0600, Daniel Santos wrote: >>> --- libgcc/config/i386/i386-asm.h.jj2018-01-03 10:42:56.317763517 >>> +0100 >>> +++ libgcc/config/i386/i386-asm.h 2018-02-22 15:33:43.81292

Re: [PATCH] Fix the GNU Stack markings on libgcc.a

2018-05-02 Thread Daniel Santos
Hello On 05/01/2018 06:32 AM, Magnus Granberg wrote: > New patch > libgcc/ChangeLog: > > 2018-05-01 Magnus Granberg > > * config/i386/resms64.h: Add .note.GNU-stack section > * config/i386/resms64f.h: Likewise. > * config/i386/resms64fx.h: Likewise. > * config/i386/resms

Re: [PATCH] Fix the GNU Stack markings on libgcc.a

2018-05-02 Thread Daniel Santos
On 05/02/2018 06:17 PM, Magnus Granberg wrote: > torsdag 3 maj 2018 kl. 01:07:51 CEST skrev Daniel Santos: >> Hello >> >> On 05/01/2018 06:32 AM, Magnus Granberg wrote: >>> New patch >>> libgcc/ChangeLog: >>> >>> 2018-05-01 Magnus Gran

[PATCH] [testsuite/i386] PR 82268 Correct FAIL when configured --with-cpu

2017-10-27 Thread Daniel Santos
When I originally wrote this test I wasn't wasn't aware of the --with-cpu configure option, so this change explicitly disables avx to make sure we choose the sse implementation, even when --with-cpu specifies an arch that has avx support. OK for head? gcc/testsuite/ChangeLog: gcc.target/

[PATCH 0/2] [i386] PR82002 Correct ICE with large stack frame

2017-10-30 Thread Daniel Santos
I originally intended to submit the first part of this patch set a few weeks ago as it was simpler, but here is the full fix.  The first part is a really simple follow-up fix to an off-by-one error H.J. originally fixed with r252099, but in the process of testing I discovered a more complex problem

[PATCH 1/2] [i386] PR82002 Part 1: Correct ICE caused by wrong calculation.

2017-10-30 Thread Daniel Santos
test. gcc.target/i386/pr82002-2a.c: New xfail test. gcc.target/i386/pr82002-2b.c: New xfail test. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 2 +- gcc/testsuite/gcc.target/i386/pr82002-1.c | 12 gcc/testsuite/gcc.target/i386/pr82002-2a.c

[PATCH 2/2] [i386] PR82002 Part 2: Correct non-immediate offset/invalid INSN

2017-10-30 Thread Daniel Santos
get/i386/pr82002-2b.c: Likewise. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 76 -- gcc/testsuite/gcc.target/i386/pr82002-2a.c | 2 - gcc/testsuite/gcc.target/i386/pr82002-2b.c | 2 - 3 files changed, 62 insertions(+), 18 deletions

Re: [PATCH 2/2] [i386] PR82002 Part 2: Correct non-immediate offset/invalid INSN

2017-10-30 Thread Daniel Santos
On 10/30/2017 09:09 PM, Daniel Santos wrote: > 3. Modify choose_baseaddr to take an optional scratch_regno argument >and never return rtx that cannot be used as an immediate. I should amend this, it actually does a gcc_assert, so that won't happen if --enable-checking=no, but it

Re: [PATCH 2/2] [i386] PR82002 Part 2: Correct non-immediate offset/invalid INSN

2017-11-02 Thread Daniel Santos
On 10/31/2017 04:31 AM, Uros Bizjak wrote: > On Tue, Oct 31, 2017 at 3:09 AM, Daniel Santos > wrote: >> When we are realigning the stack pointer, making an ms_abi to sysv_abi >> call and alllocating 2GiB or more on the stack we end up with an invalid >> INSN due to a non

Re: [PATCH 2/2] [i386] PR82002 Part 2: Correct non-immediate offset/invalid INSN

2017-11-03 Thread Daniel Santos
On 11/03/2017 02:09 AM, Uros Bizjak wrote: > On Thu, Nov 2, 2017 at 11:43 PM, Daniel Santos > wrote: > >>>>int_registers_saved = (frame.nregs == 0); >>>>sse_registers_saved = (frame.nsseregs == 0); >>>> + save_stub_call_n

Re: [PATCH 2/2] [i386] PR82002 Part 2: Correct non-immediate offset/invalid INSN

2017-11-03 Thread Daniel Santos
On 11/03/2017 04:22 PM, Daniel Santos wrote: > ... > How does this patch look?  (Also, I've updated comments for > choose_baseaddr.)  Currently re-running tests. > > Thanks, > Daniel > > @@ -13110,10 +13125,26 @@ ix86_expand_prologue (void) >target. */ &g

PING: [PATCH v2 0/2] [testsuite, libgcc] PR80759 Fix FAILs on Solaris and Darwin

2017-07-17 Thread Daniel Santos
lease? Thank you all! Daniel On 07/02/2017 12:11 AM, Daniel Santos wrote: This patchset addresses a number of testsuite issues for gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp, mostly occurring on Solaris and Darwin. Additionally, it solves a bug in libgcc that caused link failures on Darwin

Re: [PING] [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-07-26 Thread Daniel Santos
On 07/26/2017 02:03 PM, H.J. Lu wrote: This patch caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81563 Yes, I discovered this flaw while working on PR 80969 but I hadn't found an actual testcase where it caused a problem yet. I'm about to submit my patchset for review, so sorry I didn

Re: [PING] [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-07-28 Thread Daniel Santos
On 07/26/2017 02:03 PM, H.J. Lu wrote: This patch caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81563 Hello. I've rebased my patch set and I'm now retesting. I'm afraid that your changes are wrong because my my sp_valid_at and fp_valid_at functions are wrong -- these are supposed to

Re: [PING] [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-07-31 Thread Daniel Santos
On 07/28/2017 09:41 AM, H.J. Lu wrote: On Fri, Jul 28, 2017 at 6:57 AM, Daniel Santos wrote: On 07/26/2017 02:03 PM, H.J. Lu wrote: This patch caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81563 Hello. I've rebased my patch set and I'm now retesting. I'm afraid th

[PATCH 0/6] [i386] PR80969 Fix ICE with -mabi=ms -mavx512f

2017-07-31 Thread Daniel Santos
the tests for pr80969-4*.c. As an aside note, I still have some rework of the ms-sysv.exp tests that I haven't yet to submitted and in which I'm adding more tests for cases with uncommon stacks, as in PR 81563. Thanks, Daniel 2017-07-23 Daniel Santos * confi

[PATCH 1/6] [i386] Correct comments, add assertions to sp_valid_at and fp_valid_at

2017-07-31 Thread Daniel Santos
rect) behaviour of sp_valid_at and fp_valid_at prior to r250587 and this change now corrects the documentation and adds clarification of the CFA-relative calculation. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 45 ++--- gcc/config/i

[PATCH 2/6] [i386] Remove ix86_frame::outlined_save_offset

2017-07-31 Thread Daniel Santos
This value was used in an earlier incarnation of the -mcall-ms2sysv-xlogues patch set but is now set and never read. The value of ix86_frame::sse_reg_save_offset serves the same purpose. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 1 - gcc/config/i386/i386.h | 4 +--- 2 files

[PATCH 3/6] [i386] Remove machine_function::call_ms2sysv_pad_out

2017-07-31 Thread Daniel Santos
ROUND_UP calculation for the stack offset at the start of the function body (frame.frame_pointer_offset) will assure there is enough room for any padding needed to keep the save area for SSE va_args 16-byte aligned, so no modification is needed for that calculation. Signed-off-by: Daniel Santos

[PATCH 4/6] [i386] Modify ix86_compute_frame_layout

2017-07-31 Thread Daniel Santos
results in a properly aligned stack for the function body and avoids wasting stack space. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 116 + gcc/config/i386/i386.h | 2 +- 2 files changed, 80 insertions(+), 38 deletions(-) diff --git a

[PATCH 5/6] [i386] Modify SP realignment in ix86_expand_prologue, et. al.

2017-07-31 Thread Daniel Santos
(e.g., you can pass cfa_offset 48 and it can return an alignment of 64 bytes). Since the alignment required may be more than 16-bytes, we cannot defer SP allocation to ix86_emit_outlined_ms2sysv_save (when it's enabled), so that function needs to be updated as well. Signed-off-by: Dan

[PATCH 6/6] [i386, testsuite] Add tests, fix bug in check_avx2_hw_available

2017-07-31 Thread Daniel Santos
va_args passed via va_list pr80969-4a.c With va_args passed via va_list and ms to sysv call. pr80969-4b.c With va_args passed via va_list and ms to sysv call using stubs. Signed-off-by: Daniel Santos --- gcc/testsuite/gcc.target/i386/pr80969-1.c | 16 gcc/testsuite

Re: [PATCH 0/6] [i386] PR80969 Fix ICE with -mabi=ms -mavx512f

2017-07-31 Thread Daniel Santos
Well I just learned how to test 32-bit earlier and I've uncovered a problem when running 32-bit tests. Do you want me to commit the the two patches (squashed together) in the mean time? Thanks, Daniel

[PATCH 5/6 v2] [i386] Modify SP realignment in ix86_expand_prologue, et. al.

2017-08-02 Thread Daniel Santos
hat function needs to be updated as well. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 58 -- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0dc366cf16e..a1f39cd7

[PATCH 6/6 v2] [i386, testsuite] Add tests, fix bug in check_avx2_hw_available

2017-08-08 Thread Daniel Santos
to sysv call using stubs. Signed-off-by: Daniel Santos --- gcc/doc/sourcebuild.texi | 12 +++ gcc/testsuite/gcc.target/i386/pr80969-1.c | 16 gcc/testsuite/gcc.target/i386/pr80969-2.c | 26 ++ gcc/testsuite/gcc.target/i386/pr80969-2a.c | 26

PING Re: [PATCH 0/6] [i386] PR80969 Fix ICE with -mabi=ms -mavx512f

2017-08-08 Thread Daniel Santos
Committed. 3. Committed. 4. https://gcc.gnu.org/ml/gcc-patches/2017-07/msg02009.html 5. v2 -- https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00249.html 6. v2 -- https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00618.html Thanks, Daniel 2017-08-08 Daniel Santos * config/i386/i386.

[PATCH] [i386,testsuite] [PR 71958] Error on -mx32 with -mabi=ms

2017-08-11 Thread Daniel Santos
s now and will run x32 tests when those are done. Presuming that I've corrected all existing tests that do not filter out x32 target and there are no additional failures, is this OK for head? Thanks, Daniel gcc/ChangeLog: 2017-08-11 Daniel Santos * config/i

[PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-21 Thread Daniel Santos
It took me a while to figure out how to do this so I figured that it should be in the docs. OK for trunk? * doc/install.texi: Add more details on selecting multiple tests. Thanks, Daniel Signed-off-by: Daniel Santos --- gcc/doc/install.texi | 10 ++ 1 file changed, 10

[PATCH] [i386, testsuite] [PR 71958] Error on -mx32 with -mabi=ms

2017-08-21 Thread Daniel Santos
a "normal" x86_64-pc-linux-gnu testing with --target_board=unix/\{,-m32\}, and * on Windows. OK for trunk? gcc/ChangeLog: 2017-08-11 Daniel Santos * config/i386/i386.c (ix86_option_override_internal): Error when -mx32 is combined with -mabi=ms. (ix86_funct

[PATCH] [i386] PR 81850 Don't ignore -mabi=sysv on Cygwin/MinGW

2017-08-21 Thread Daniel Santos
legal values are equivalent to zero. Thanks, Daniel Signed-off-by: Daniel Santos --- gcc/config/i386/i386-opts.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386-opts.h b/gcc/config/i386/i386-opts.h index 542cd0f3d67..8c2b5380e49 100644 --- a/gcc/confi

Re: [PATCH] [i386] PR 81850 Don't ignore -mabi=sysv on Cygwin/MinGW

2017-08-22 Thread Daniel Santos
On 08/22/2017 01:26 AM, Andreas Schwab wrote: > On Aug 21 2017, Daniel Santos wrote: > >> This is a problem that occured because of this code in >> ix86_option_override_internal: >> >> if (!opts_set->x_ix86_abi) >> opts->x_ix86_abi = DEFAULT_ABI;

Re: [PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-22 Thread Daniel Santos
On 08/22/2017 10:58 AM, Martin Sebor wrote: > On 08/21/2017 07:41 PM, Daniel Santos wrote: >> It took me a while to figure out how to do this so I figured that it >> should be >> in the docs. OK for trunk? >> >> * doc/install.texi: Add more details on select

[PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-22 Thread Daniel Santos
OK, how's this one? * doc/install.texi: Modify to add more details on running selected tests. Thanks, Daniel Signed-off-by: Daniel Santos --- gcc/doc/install.texi | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi

Re: [PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-22 Thread Daniel Santos
On 08/22/2017 12:32 PM, Mike Stump wrote: > On Aug 22, 2017, at 10:32 AM, Daniel Santos wrote: >>> I would suggest "escaped or quoted." >>> The whole argument to RUNTESTFLAGS can be quoted in either single >>> or double quotes and, AFAICT, so can the

Re: [PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-22 Thread Daniel Santos
On 08/22/2017 12:32 PM, Mike Stump wrote: > On Aug 22, 2017, at 10:32 AM, Daniel Santos wrote: >>> I would suggest "escaped or quoted." >>> The whole argument to RUNTESTFLAGS can be quoted in either single >>> or double quotes and, AFAICT, so can the

Re: [PATCH] [docs] Explain how to use multiple file-name patterns in RUNTESTFLAGS

2017-08-22 Thread Daniel Santos
OK, the problem is at line 4014 of gcc/Makefile.in: $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \ check-parallel-$* \ Even worse, one can inject arbitrary shell commands here, not that I can think of a scenario where it would be an actual security

[PATCH] [i386] PR 81850 Don't ignore -mabi=sysv on Cygwin/MinGW

2017-08-22 Thread Daniel Santos
> Please add UNKNOWN_ABI to the enum and initialize -mabi in i386.opt to > UNKNOWN_ABI. It would seem to me that UNSPECIFIED_ABI would be a better value name. Also, I don't really understand what opts_set and opts are, except that I had guessed opts_set is what the user asked for (or didn't ask f

[PATCH v4 0/4] [i386] PR80969 Fix ICE with -mabi=ms -mavx512f

2017-08-22 Thread Daniel Santos
ersion 2 of the whole patch set. OK for trunk? 2017-08-22 Daniel Santos * config/i386/i386.h (ix86_frame::stack_realign_allocate_offset): Remove field. (ix86_frame::stack_realign_allocate): New field. (struct machine_frame_state): Modify comments. (mach

[PATCH 1/4] [i386] Correct comments, add assertions to sp_valid_at and fp_valid_at

2017-08-22 Thread Daniel Santos
rect) behaviour of sp_valid_at and fp_valid_at prior to r250587 and this change now corrects the documentation and adds clarification of the CFA-relative calculation. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 45 ++--- gcc/config/i

[PATCH 2/4] [i386] Modify ix86_compute_frame_layout

2017-08-22 Thread Daniel Santos
results in a properly aligned stack for the function body and avoids wasting stack space. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 116 + gcc/config/i386/i386.h | 2 +- 2 files changed, 80 insertions(+), 38 deletions(-) diff --git a

[PATCH 3/4] [i386] Modify SP realignment in ix86_expand_prologue, et. al.

2017-08-22 Thread Daniel Santos
ment of 64 bytes). Since the alignment required may be more than 16-bytes, we cannot defer SP allocation to ix86_emit_outlined_ms2sysv_save (when it's enabled), so that function needs to be updated as well. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 58

[PATCH 4/4] [i386, testsuite] Add tests, fix bug in check_avx2_hw_available

2017-08-22 Thread Daniel Santos
). pr80969-4.c With va_args passed via va_list pr80969-4a.c With va_args passed via va_list and ms to sysv call. pr80969-4b.c With va_args passed via va_list and ms to sysv call using stubs. pr80969-4.h Common header for pr80969-4*.c. Signed-off-by: Daniel Santos --- gcc/doc

Re: [PATCH] [i386] PR 81850 Don't ignore -mabi=sysv on Cygwin/MinGW

2017-08-22 Thread Daniel Santos
On 08/22/2017 03:00 PM, Uros Bizjak wrote: > On Tue, Aug 22, 2017 at 9:47 PM, Daniel Santos > wrote: >>> Please add UNKNOWN_ABI to the enum and initialize -mabi in i386.opt to >>> UNKNOWN_ABI. >> It would seem to me that UNSPECIFIED_ABI would be a better value na

Re: [PATCH 4/4] [i386, testsuite] Add tests, fix bug in check_avx2_hw_available

2017-08-23 Thread Daniel Santos
On 08/23/2017 08:26 AM, Uros Bizjak wrote: >> @@ -1822,6 +1845,7 @@ proc check_avx2_hw_available { } { >> expr 0 >> } else { >> check_runtime_nocache avx2_hw_available { >> + #include > Why is the above include needed? It is only needed to #define N

Re: [PATCH] [i386] PR 81850 Don't ignore -mabi=sysv on Cygwin/MinGW

2017-08-23 Thread Daniel Santos
On 08/23/2017 01:12 AM, Uros Bizjak wrote: > On Wed, Aug 23, 2017 at 7:23 AM, Daniel Santos > wrote: >> On 08/22/2017 03:00 PM, Uros Bizjak wrote: >>> On Tue, Aug 22, 2017 at 9:47 PM, Daniel Santos >>> wrote: >>>>> Please add UNKNOWN_ABI to

Re: [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-05-06 Thread Daniel Santos
On 05/05/2017 03:56 AM, Daniel Santos wrote: On 05/02/2017 05:40 AM, Kai Tietz wrote: Right, and Wine people will tell, if something doesn't work for them. So ok for me too. Kai Well, I haven't re-run these tests in a few months, but I got 272 failed wine tests with gcc 7.1 and 2

Re: [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-05-08 Thread Daniel Santos
On 05/06/2017 03:22 PM, Daniel Santos wrote: gcc-5.4.0 CFLAGS="-march=native -O2 -g": 74 gcc-7.1.0 CFLAGS="-march=native -O2 -g": 74 gcc-7.1.0 CFLAGS="-march=nocona -mtune=generic -O2 -g": 79 gcc-7.1.0 CFLAGS="-march=native -O2 -g -mcall-ms2sysv-xlogues&q

[PING] [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-05-12 Thread Daniel Santos
Ping? I have posted revisions of the following in patch set: 05/12 - https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01442.html 09/12 - https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00348.html 11/12 - https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00350.html I have retested them on Linux x86-64 in

Re: [PING] [PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-05-13 Thread Daniel Santos
On 05/13/2017 11:52 AM, Uros Bizjak wrote: On Sat, May 13, 2017 at 1:01 AM, Daniel Santos wrote: Ping? I have posted revisions of the following in patch set: 05/12 - https://gcc.gnu.org/ml/gcc-patches/2017-04/msg01442.html 09/12 - https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00348.html 11

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-14 Thread Daniel Santos
On 05/14/2017 02:42 AM, Bernd Edlinger wrote: Hi, this patch uses the new TARGET_COMPUTE_FRAME_LAYOUT hook in the i386 backend to avoid re-computing the frame layout when not really necessary. It simplifies the logic in ix86_compute_frame_layout by removing the use_fast_prologue_epilogue_nregs

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-14 Thread Daniel Santos
On 05/14/2017 11:31 AM, Bernd Edlinger wrote: Hi Daniel, there is one thing I don't understand in your patch: That is, it introduces a static value: /* Registers who's save & restore will be managed by stubs called from pro/epilogue. */ static HARD_REG_SET GTY(()) stub_managed_regs; This

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-14 Thread Daniel Santos
On 05/14/2017 11:31 AM, Bernd Edlinger wrote: Hi Daniel, there is one thing I don't understand in your patch: That is, it introduces a static value: /* Registers who's save & restore will be managed by stubs called from pro/epilogue. */ static HARD_REG_SET GTY(()) stub_managed_regs; This

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-15 Thread Daniel Santos
On 05/15/2017 03:39 PM, Bernd Edlinger wrote: On 05/15/17 03:39, Daniel Santos wrote: On 05/14/2017 11:31 AM, Bernd Edlinger wrote: Hi Daniel, there is one thing I don't understand in your patch: That is, it introduces a static value: /* Registers who's save & restore will

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-15 Thread Daniel Santos
Ian, would you mind looking at this please? A combination of my -mcall-ms2sysv-xlogues patch with Bernd's patch is causing problems when ix86_expand_split_stack_prologue() calls ix86_expand_call(). On 05/15/2017 06:46 PM, Daniel Santos wrote: Rather or not m->call_ms2sysv is set de

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-16 Thread Daniel Santos
On 05/16/2017 03:34 AM, Bernd Edlinger wrote: It would be good to have test cases for each of the not-supported warnings that can happen, so far I only managed to get a test case for -fsplit-stack. Yes, I'm inclined to agree. I'll try to get this done today or tomorrow. I've also put in a li

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-16 Thread Daniel Santos
On 05/16/2017 12:19 PM, Ian Lance Taylor wrote: On Mon, May 15, 2017 at 10:00 PM, Daniel Santos wrote: Ian, would you mind looking at this please? A combination of my -mcall-ms2sysv-xlogues patch with Bernd's patch is causing problems when ix86_expand_split_stack_prologue()

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-16 Thread Daniel Santos
On 05/16/2017 02:52 PM, Bernd Edlinger wrote: I think I solved the problem with -fsplit-stack, I am not sure if ix86_static_chain_on_stack might change after reload due to final.c possibly calling targetm.calls.static_chain, but if that is the case, that is an already pre-existing problem. The g

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-17 Thread Daniel Santos
On 05/17/2017 12:41 PM, Bernd Edlinger wrote: Apologies if I ruined your patch... As I said before, I'm the new guy here. :) So when this is done I'll rebase my changes. I have some test stuff to fix and some refactoring and refinements to xlogue_layout::compute_stub_managed_regs(). And then

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
On 05/17/2017 01:39 PM, Bernd Edlinger wrote: On 05/15/17 03:39, Daniel Santos wrote: I should add that if you want to run faster tests just on the ms to sysv abi code, you can use make RUNTESTFLAGS="ms-sysv.exp" check and then if that succeeds run the full testsuite. Daniel H

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
On 05/18/2017 08:37 AM, Bernd Edlinger wrote: On 05/17/17 04:01, Daniel Santos wrote: - if (ignore_outlined && cfun->machine->call_ms2sysv - && in_hard_reg_set_p (stub_managed_regs, DImode, regno)) -return false; + if (ignore_outlined &&am

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-18 Thread Daniel Santos
PS: Oh! it might be due to the difference between -j1 and no -j argument. Yes, that's how I missed it. This flaw isn't exposed with make -j1, but is exposed with just make. Thanks for finding this! Daniel

[PATCH 0/2] [testsuite] PR80759 Fix test breakages on i386-pc-solaris2.*

2017-05-18 Thread Daniel Santos
There are a few issues with my ms-sysv.exp tests: 1. Use of gas extensions in do_test.S cause breakages on Solaris, 2. Parallelization breaks when no make -j flag is passed, 3. Builds aren't adding TEST_ALWAYS_FLAGS, so log files filled with color escape codes, and 4. The "test unsupported" me

[PATCH 2/2] [testsuite] PR 80759 Remove gas extensions from do-test.S, fix other problems

2017-05-18 Thread Daniel Santos
Use of .struct in do_test.S causes breakages when gas isn't the assembler (e.g., Solaris). I also wasn't including TEST_ALWAYS_FLAGS in my CFLAGS resulting in super-ugly log files. Finally, this patch eliminates spam of "test unsupported" (limiting it to one printing). S

[PATCH 1/2] [testsuite] Move non-standard parallelization support into new lib and fix flaw

2017-05-18 Thread Daniel Santos
#x27;s own file under gcc/testsuite/lib. Signed-off-by: Daniel Santos --- .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp | 48 gcc/testsuite/lib/parallelize.exp | 88 ++ 2 files changed, 103 insertions(+), 33 deletions(-) create mode 100644 gc

Re: [PATCH 2/2] [testsuite] PR 80759 Remove gas extensions from do-test.S, fix other problems

2017-05-19 Thread Daniel Santos
n gas isn't the assembler (e.g., Solaris). I also wasn't including TEST_ALWAYS_FLAGS in my CFLAGS resulting in super-ugly log files. Finally, this patch eliminates spam of "test unsupported" (limiting it to one printing). Signed-off-by: Daniel Santos --- .../g

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-23 Thread Daniel Santos
On 05/22/2017 01:32 PM, Bernd Edlinger wrote: On 05/19/17 05:17, Daniel Santos wrote: No, I'm not at all comfortable with you making so many seemingly unnecessary changes to this code. (Although I wish I got this much feedback during my RFCs! :) I can accept the changes

Re: [PATCH] [i386] Recompute the frame layout less often

2017-05-23 Thread Daniel Santos
On 05/23/2017 09:31 AM, Bernd Edlinger wrote: Hi, this is the latest version of my patch. As already said, it attempts to compute the frame layout only when relevant data have changed. Apologies for doing more clean-up on Daniel's patch than absolutely necessary, but ... Bootstrap and reg-tes

Use aligned SSE movs for re-aligned MS ABI pro/epilogues

2016-12-22 Thread Daniel Santos
l refining that out-of-lines these pro/epilogues. I'm still pretty new to this project, so I hope I haven't missed anything. (No additional failures in tests.) Daniel Santos 2016-12-21 Daniel Santos * config/i386/i386.h (struct machine_frame_state): New fields

[PATCH 2/3] [i386] Keep stack pointer valid after after re-alignment.

2016-12-22 Thread Daniel Santos
This stage adds the fields sp_realigned and sp_realigned_offset to struct machine_frame_state and adds the concept of the stack pointer being re-aligned rather than invalid. The inline functions sp_valid_at and fp_valid_at are added to test if a given location relative to the CFA can be accessed w

[PATCH 1/3] [i386] Move stack frame re-alignment to before SSE saves.

2016-12-22 Thread Daniel Santos
This step adds new fields to struct ix86_frame to track where we started the stack re-alignment and what we need to allocate prior to re-alignment. In ix86_compute_frame_layout, we do the stack frame re-alignment computation prior to computing the SSE save area so that it we have an aligned SSE sa

[PATCH 3/3] [i386] Use re-aligned stack pointer for aligned SSE movs

2016-12-22 Thread Daniel Santos
This adds an optional `align' parameter to choose_baseaddr allowing the caller to request an address that is aligned to some boundary. Then ix86_emit_save_regs_using_mov and ix86_emit_restore_regs_using_mov are modified so that optimally aligned memory is used when such a base register is availabl

Re: Use aligned SSE movs for re-aligned MS ABI pro/epilogues

2016-12-27 Thread Daniel Santos
On 12/27/2016 07:56 AM, Uros Bizjak wrote: Hello! According to the Microsoft 64-bit ABI specification, registers RDI, RSI and XMM6-15 are non-volatile and the stack alignment is 16 bytes. In practice, the Windows implementation appears to not be so picky about the 16-byte alignment requiremen

Re: [RFC] [PATCH v3 0/8] [i386] Use out-of-line stubs for ms_abi pro/epilogues

2017-03-30 Thread Daniel Santos
I have finally completed all tests for Cygwin and MinGW both 32- & 64-bit with no additional test failures. There are still 567 tests failing both pre- and post-patch with error "error while loading shared libraries: cyggfortran-4.dll: cannot open shared object file: No such file or directory"

Re: [PATCH 2/8] [i386] Add option -moutline-msabi-xlogues

2017-04-01 Thread Daniel Santos
Uros, can I please get your opinion on this? I have no objections to this, but I want to check with you first. On 02/10/2017 10:54 AM, Sandra Loosemore wrote: I'd like to re-iterate my previous request that the option be renamed -mno-inline-msabi-xlogues. No other option that controls inlinin

Re: [RFC] [PATCH] [i386] Test program for ms_abi to sysv_abi function calls

2017-04-01 Thread Daniel Santos
I've had to make changes to the test program, as I was using XSI extensions which aren't implemented on Cygwin. But before I post the new patch, I noticed that it may be in the wrong directory. There is a gcc/testsuite/gcc.target/x86_64/abi directory and even a callabi subdirectory of that. F

[testsuite] Fix loading wrong DLLs on Windows, merge duplicate target-libpath.exp

2017-04-03 Thread Daniel Santos
set_ld_library_path_env_vars and restore_ld_library_path_env_vars. However, there is still incorrect behaviour in DejaGNU's unix_load that should eventually be adddressed, although I cannot yet point to a specific failure that it is causing. gcc/ChangeLog: 2017-04-03 Daniel Santos PR testsuite/

Re: [PATCH, testsuite] PR79867: Fix loading wrong DLLs on Windows, merge duplicate target-libpath.exp

2017-04-03 Thread Daniel Santos
I forgot to include PATCH and the PR in the subject line, sorry about that. Also, I have run a full bootstrap and testsuite to verify that I haven't missed any references to the extraneous copy of target-libpath.exp in libffi.

Re: [testsuite] Fix loading wrong DLLs on Windows, merge duplicate target-libpath.exp

2017-04-05 Thread Daniel Santos
On 04/05/2017 12:35 PM, Mike Stump wrote: libffi/ChangeLog: 2017-04-03 Daniel Santos PR testsuite/79867 * testsuite/lib/target-libpath.exp: Remove. * testsuite/Makefile.in: Remove target-libpath.exp. * testsuite/Makefile.am: Regenerated. I don't thin

[PATCH v2,testsuite] PR79867: Merge fixes for windows DLL loading problem from libffi

2017-04-06 Thread Daniel Santos
ll have to keep this code in gcc for when DejaGNU doesn't have set/restore or push/pop libpath functionality. Signed-off-by: Daniel Santos --- gcc/testsuite/lib/target-libpath.exp | 21 + 1 file changed, 21 insertions(+) diff --git a/gcc/testsuite/lib/target-libpath.exp

[PATCH v4 0/12] [i386] Improve 64-bit Microsoft to System V ABI pro/epilogues

2017-04-27 Thread Daniel Santos
| 55 ++ libgcc/config/i386/t-msabi | 7 + 21 files changed, 3020 insertions(+), 95 deletions(-) gcc/ChangeLog: 2017-04-25 Daniel Santos * config/i386/i386.opt: Add option -mcall-ms2sysv-xlogues. * config/i386/i386.h (x86_64_ms_sysv_extra_c

[PATCH 02/12] [i386] Keep stack pointer valid after after re-alignment.

2017-04-27 Thread Daniel Santos
s how SSE registers are saved, moving the re-alignment AND should not hinder parallelization of int register saves. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 74 +- gcc/config/i386/i386.h | 11 2 files changed, 66 insertions(+

[PATCH 01/12] [i386] Re-align stack frame prior to SSE saves.

2017-04-27 Thread Daniel Santos
. This new also assures that the SSE save area is properly aligned when DRAP is used. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386

[PATCH 04/12] [i386] Minor refactoring

2017-04-27 Thread Daniel Santos
For the sake of clarity, I've separated out these minor refactoring changes from the remainder of this patch set. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 21 ++--- gcc/config/i386/i386.h | 4 +++- 2 files changed, 13 insertions(+), 12 deletions(-) diff

[PATCH 03/12] [i386] Use re-aligned stack pointer for aligned SSE movs

2017-04-27 Thread Daniel Santos
Add an optional `align' parameter to choose_baseaddr, allowing the caller to request an address that is aligned to some boundary. Modify ix86_emit_save_regs_using_mov and ix86_emit_restore_regs_using_mov use optimally aligned memory when such a base register is available. Signed-off-by: D

[PATCH 05/12] [i386] Add option -mcall-ms2sysv-xlogues

2017-04-27 Thread Daniel Santos
unwind emit code in gcc/config/i386/winnt.c -- this is the same for use of aligned SSE MOVs after a realigned stack pointer. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 6 +- gcc/config/i386/i386.opt | 4 gcc/doc/invoke.texi | 13 - 3 files changed, 21

[PATCH 09/12] [i386] Add patterns and predicates foutline-msabi-xlouges

2017-04-27 Thread Daniel Santos
typically offer better optimization than the restore stub as the tail call) * restore_multiple_and_return - a jump_insn that returns from the function as a tail-call. * restore_multiple_leave_return - like the above, but restores the frame pointer before returning. Signed-off-by: Daniel Santos

[PATCH 10/12] [i386] Add ms2sysv pro/epilogue stubs to libgcc

2017-04-27 Thread Daniel Santos
ysv scenario) [f] Variant for hard frame pointer (and stack realignment) [x] Tail-call variant (is the return from function) The number of registers to save. Signed-off-by: Daniel Santos --- libgcc/config.host | 2 +- libgcc/config/i386/i386-as

[PATCH 08/12] [i386] Modify ix86_compute_frame_layout for -mcall-ms2sysv-xlogues

2017-04-27 Thread Daniel Santos
d by the out-of-line stub and which are being managed inline, as it is possible to have registers being managed both inline and out-of-line when inline asm explicitly clobbers a register. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 94 +++---

[PATCH 06/12] [i386] Add class xlogue_layout and new fields to struct machine_function

2017-04-27 Thread Daniel Santos
the appropriate (constant) instance of xlouge_layout. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 262 + gcc/config/i386/i386.h | 18 2 files changed, 280 insertions(+) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c i

[PATCH 07/12] [i386] Modify ix86_save_reg to optionally omit stub-managed registers

2017-04-27 Thread Daniel Santos
. Signed-off-by: Daniel Santos --- gcc/config/i386/i386.c | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2da3da1f97a..4f0cb7dd6cc 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386

[PATCH 11/12] [i386] Add remainder of -mcall-ms2sysv-xlogues implementation

2017-04-27 Thread Daniel Santos
d-off-by: Daniel Santos --- gcc/config/i386/i386.c | 281 +++-- 1 file changed, 272 insertions(+), 9 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index debfe457d97..6a4e6f8e728 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/c

  1   2   >