aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog29
-rw-r--r--gcc/config/i386/i386.c25
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/config/i386/i386.md27
4 files changed, 64 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a143ba..38c47b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2016-03-07 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70064
+ * config/i386/i386.h (machine_function): Add
+ pc_thunk_call_expanded flag.
+ (ix86_pc_thunk_call_expanded): New define.
+ * config/i386/i386.md (set_got, set_got_labelled): New expanders.
+ (*set_got): Rename insn pattern from set_got.
+ (*set_got_labelled): Rename inst pattern from set_got_labelled.
+ * config/i386/i386.c (ix86_compute_frame_layout): Use
+ ix86_pc_thunk_call_expanded to prevent red-zone.
+
2016-03-07 Martin Jambor <mjambor@suse.cz>
* hsa.h (hsa_get_ctor_statements): Declare.
@@ -26,7 +38,7 @@
-fno-branch-count-reg.
2016-02-26 Richard Biener <rguenther@suse.de>
- Jeff Law <law@redhat.com>
+ Jeff Law <law@redhat.com>
PR tree-optimization/69740
* cfghooks.c (remove_edge): Request loop fixups if we delete
@@ -86,11 +98,11 @@
2016-03-05 Venkataramanan Kumar <Venkataramanan.kumar@amd.com>
Fix sseimul type attribute.
- * config/i386/znver1.md
+ * config/i386/znver1.md
(znver1_sseimul, znver1_sseimul_avx256, znver1_sseimul_load,
znver1_sseimul_avx256_load) : Fix the type attribute.
- (znver1_sseimul_di,
- znver1_sseimul_load_di): Fix type attribute, pipe usage and latency.
+ (znver1_sseimul_di, znver1_sseimul_load_di): Fix type attribute,
+ pipe usage and latency.
2016-03-05 Jakub Jelinek <jakub@redhat.com>
@@ -220,8 +232,8 @@
* gimplify.c (gimplify_decl_expr): For decls with REFERENCE_TYPE, also
gimplify_type_sizes the type they refer to.
(omp_notice_variable): Handle reference vars to VLAs.
- * omp-low.c (lower_omp_target): Emit setup of OMP_CLAUSE_PRIVATE reference
- to VLA decls in the second pass instead of first pass.
+ * omp-low.c (lower_omp_target): Emit setup of OMP_CLAUSE_PRIVATE
+ reference to VLA decls in the second pass instead of first pass.
2016-03-02 Tom de Vries <tom@codesourcery.com>
@@ -264,7 +276,7 @@
* config.gcc (mep-*-elf): Add newlib-stdint.h to tm_file.
2016-03-02 Richard Biener <rguenther@suse.de>
- Uros Bizjak <ubizjak@gmail.com>
+ Uros Bizjak <ubizjak@gmail.com>
PR target/67278
* config/i386/i386.c (type_natural_mode): Handle XFmode vectors.
@@ -307,7 +319,8 @@
* tree-ssa-threadbackward.c (fsm_find_control_statement_thread_paths):
Do count some PHIs in the thread path against the insn count. Decrease
final statement count by one as the control statement in the last
- block will get removed. Remove special cased code for handling PHIs in the last block.
+ block will get removed. Remove special cased code for handling PHIs
+ in the last block.
2016-03-01 Uros Bizjak <ubizjak@gmail.com>
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 27fb15e..5155a00 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -11103,18 +11103,7 @@ output_set_got (rtx dest, rtx label)
xops[1] = gen_rtx_SYMBOL_REF (Pmode, GOT_SYMBOL_NAME);
- if (!flag_pic)
- {
- if (TARGET_MACHO)
- /* We don't need a pic base, we're not producing pic. */
- gcc_unreachable ();
-
- xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ());
- output_asm_insn ("mov%z0\t{%2, %0|%0, %2}", xops);
- targetm.asm_out.internal_label (asm_out_file, "L",
- CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
- }
- else
+ if (flag_pic)
{
char name[32];
get_pc_thunk_name (name, REGNO (dest));
@@ -11139,6 +11128,17 @@ output_set_got (rtx dest, rtx label)
CODE_LABEL_NUMBER (label));
#endif
}
+ else
+ {
+ if (TARGET_MACHO)
+ /* We don't need a pic base, we're not producing pic. */
+ gcc_unreachable ();
+
+ xops[2] = gen_rtx_LABEL_REF (Pmode, label ? label : gen_label_rtx ());
+ output_asm_insn ("mov%z0\t{%2, %0|%0, %2}", xops);
+ targetm.asm_out.internal_label (asm_out_file, "L",
+ CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
+ }
if (!TARGET_MACHO)
output_asm_insn ("add%z0\t{%1, %0|%0, %1}", xops);
@@ -11524,6 +11524,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
if (ix86_using_red_zone ()
&& crtl->sp_is_unchanging
&& crtl->is_leaf
+ && !ix86_pc_thunk_call_expanded
&& !ix86_current_function_calls_tls_descriptor)
{
frame->red_zone_size = to_allocate;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 9062d63..027adb1 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2494,6 +2494,10 @@ struct GTY(()) machine_function {
expander to determine the style used. */
BOOL_BITFIELD use_fast_prologue_epilogue : 1;
+ /* Nonzero if the current function calls pc thunk and
+ must not use the red zone. */
+ BOOL_BITFIELD pc_thunk_call_expanded : 1;
+
/* If true, the current function needs the default PIC register, not
an alternate register (on x86) and must not use the red zone (on
x86_64), even if it's a leaf function. We don't want the
@@ -2533,6 +2537,7 @@ struct GTY(()) machine_function {
#define ix86_varargs_fpr_size (cfun->machine->varargs_fpr_size)
#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
+#define ix86_pc_thunk_call_expanded (cfun->machine->pc_thunk_call_expanded)
#define ix86_tls_descriptor_calls_expanded_in_cfun \
(cfun->machine->tls_descriptor_call_expanded_p)
/* Since tls_descriptor_call_expanded is not cleared, even if all TLS
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 7fec5de..cb8bcec 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -12470,7 +12470,18 @@
""
"ix86_expand_prologue (); DONE;")
-(define_insn "set_got"
+(define_expand "set_got"
+ [(parallel
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(const_int 0)] UNSPEC_SET_GOT))
+ (clobber (reg:CC FLAGS_REG))])]
+ "!TARGET_64BIT"
+{
+ if (flag_pic && !TARGET_VXWORKS_RTP)
+ ix86_pc_thunk_call_expanded = true;
+})
+
+(define_insn "*set_got"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(const_int 0)] UNSPEC_SET_GOT))
(clobber (reg:CC FLAGS_REG))]
@@ -12479,7 +12490,19 @@
[(set_attr "type" "multi")
(set_attr "length" "12")])
-(define_insn "set_got_labelled"
+(define_expand "set_got_labelled"
+ [(parallel
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(label_ref (match_operand 1))]
+ UNSPEC_SET_GOT))
+ (clobber (reg:CC FLAGS_REG))])]
+ "!TARGET_64BIT"
+{
+ if (flag_pic && !TARGET_VXWORKS_RTP)
+ ix86_pc_thunk_call_expanded = true;
+})
+
+(define_insn "*set_got_labelled"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI [(label_ref (match_operand 1))]
UNSPEC_SET_GOT))