summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-04-03 10:55:16 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-04-03 10:55:16 -0700
commit6a14926b44504e88488e3715b5b84928d454fb49 (patch)
tree9cf5f80773922c62ebd9ba07388a1f27354dc516 /gcc/config
parentaabd700dee5d71eb0a8180fb3626a23da9a88fdd (diff)
parent749dea2a0549c126a0e992a6dd8e9b5eb28e1cee (diff)
downloadgcc-hjl/x32/java.tar.gz
Merge remote-tracking branch 'origin/master' into hjl/x32/javahjl/x32/java
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/arm/arm.c28
-rw-r--r--gcc/config/arm/arm.h10
-rw-r--r--gcc/config/i386/biarchx32.h28
-rw-r--r--gcc/config/i386/i386.c120
-rw-r--r--gcc/config/i386/sse.md10
-rw-r--r--gcc/config/ia64/ia64.c80
-rw-r--r--gcc/config/ia64/vms.h3
-rw-r--r--gcc/config/sh/sh.c8
-rw-r--r--gcc/config/vms/make-crtlmap.awk12
-rw-r--r--gcc/config/vms/t-vms5
-rw-r--r--gcc/config/vms/vms-c.c7
-rw-r--r--gcc/config/vms/vms-crtlmap.map815
-rw-r--r--gcc/config/vms/vms-f.c31
-rw-r--r--gcc/config/vms/vms.c132
14 files changed, 1042 insertions, 247 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 9af66dd8ace..5522fc12172 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -82,6 +82,7 @@ static int arm_legitimate_index_p (enum machine_mode, rtx, RTX_CODE, int);
static int thumb2_legitimate_index_p (enum machine_mode, rtx, int);
static int thumb1_base_register_rtx_p (rtx, enum machine_mode, int);
static rtx arm_legitimize_address (rtx, rtx, enum machine_mode);
+static reg_class_t arm_preferred_reload_class (rtx, reg_class_t);
static rtx thumb_legitimize_address (rtx, rtx, enum machine_mode);
inline static int thumb1_index_register_rtx_p (rtx, int);
static bool arm_legitimate_address_p (enum machine_mode, rtx, bool);
@@ -576,6 +577,9 @@ static const struct attribute_spec arm_attribute_table[] =
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P arm_legitimate_address_p
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS arm_preferred_reload_class
+
#undef TARGET_INVALID_PARAMETER_TYPE
#define TARGET_INVALID_PARAMETER_TYPE arm_invalid_parameter_type
@@ -6226,6 +6230,30 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, bool strict_p)
return thumb1_legitimate_address_p (mode, x, strict_p);
}
+/* Worker function for TARGET_PREFERRED_RELOAD_CLASS.
+
+ Given an rtx X being reloaded into a reg required to be
+ in class CLASS, return the class of reg to actually use.
+ In general this is just CLASS, but for the Thumb core registers and
+ immediate constants we prefer a LO_REGS class or a subset. */
+
+static reg_class_t
+arm_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
+{
+ if (TARGET_32BIT)
+ return rclass;
+ else
+ {
+ if (rclass == GENERAL_REGS
+ || rclass == HI_REGS
+ || rclass == NO_REGS
+ || rclass == STACK_REG)
+ return LO_REGS;
+ else
+ return rclass;
+ }
+}
+
/* Build the SYMBOL_REF for __tls_get_addr. */
static GTY(()) rtx tls_get_addr_libfunc;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 443d2ed168d..c6b4cc09a46 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1151,16 +1151,6 @@ enum reg_class
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \
arm_small_register_classes_for_mode_p
-/* Given an rtx X being reloaded into a reg required to be
- in class CLASS, return the class of reg to actually use.
- In general this is just CLASS, but for the Thumb core registers and
- immediate constants we prefer a LO_REGS class or a subset. */
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- (TARGET_32BIT ? (CLASS) : \
- ((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS \
- || (CLASS) == NO_REGS || (CLASS) == STACK_REG \
- ? LO_REGS : (CLASS)))
-
/* Must leave BASE_REGS reloads alone */
#define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
((CLASS) != LO_REGS && (CLASS) != BASE_REGS \
diff --git a/gcc/config/i386/biarchx32.h b/gcc/config/i386/biarchx32.h
new file mode 100644
index 00000000000..69d672216ac
--- /dev/null
+++ b/gcc/config/i386/biarchx32.h
@@ -0,0 +1,28 @@
+/* Make configure files to produce biarch compiler defaulting to x32 mode.
+ This file must be included very first, while the OS specific file later
+ to overwrite otherwise wrong defaults.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#define TARGET_64BIT_DEFAULT (OPTION_MASK_ISA_64BIT | OPTION_MASK_ABI_X32)
+#define TARGET_BI_ARCH 2
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 42746e474d3..d58dafc157d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3118,8 +3118,8 @@ ix86_option_override_internal (bool main_args_p)
#endif
/* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if
- TARGET_64BIT is false. */
- if (!TARGET_64BIT)
+ TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */
+ if (TARGET_64BIT_DEFAULT && !TARGET_64BIT)
ix86_isa_flags &= ~(OPTION_MASK_ABI_64 | OPTION_MASK_ABI_X32);
#ifdef TARGET_BI_ARCH
else
@@ -32938,6 +32938,7 @@ struct expand_vec_perm_d
unsigned char perm[MAX_VECT_LEN];
enum machine_mode vmode;
unsigned char nelt;
+ bool one_operand_p;
bool testing_p;
};
@@ -33038,6 +33039,7 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum machine_mode mode,
dperm.vmode = mode;
dperm.nelt = GET_MODE_NUNITS (mode);
dperm.op0 = dperm.op1 = gen_reg_rtx (mode);
+ dperm.one_operand_p = true;
/* Extend to SImode using a paradoxical SUBREG. */
tmp1 = gen_reg_rtx (SImode);
@@ -35735,7 +35737,7 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d)
rtx target, op0, op1, x;
rtx rperm[32], vperm;
- if (d->op0 == d->op1)
+ if (d->one_operand_p)
return false;
if (TARGET_AVX2 && GET_MODE_SIZE (vmode) == 32)
;
@@ -35922,7 +35924,7 @@ expand_vec_perm_vpermil (struct expand_vec_perm_d *d)
rtx rperm[8], vperm;
unsigned i;
- if (!TARGET_AVX || d->vmode != V8SFmode || d->op0 != d->op1)
+ if (!TARGET_AVX || d->vmode != V8SFmode || !d->one_operand_p)
return false;
/* We can only permute within the 128-bit lane. */
@@ -35998,7 +36000,7 @@ expand_vec_perm_pshufb (struct expand_vec_perm_d *d)
nelt = d->nelt;
- if (d->op0 != d->op1)
+ if (!d->one_operand_p)
{
if (!TARGET_XOP || GET_MODE_SIZE (d->vmode) != 16)
{
@@ -36086,7 +36088,7 @@ expand_vec_perm_pshufb (struct expand_vec_perm_d *d)
else
{
eltsz = GET_MODE_SIZE (GET_MODE_INNER (d->vmode));
- if (d->op0 != d->op1)
+ if (!d->one_operand_p)
mask = 2 * nelt - 1;
else if (vmode == V16QImode)
mask = nelt - 1;
@@ -36113,7 +36115,7 @@ expand_vec_perm_pshufb (struct expand_vec_perm_d *d)
target = gen_lowpart (vmode, d->target);
op0 = gen_lowpart (vmode, d->op0);
- if (d->op0 == d->op1)
+ if (d->one_operand_p)
{
if (vmode == V16QImode)
emit_insn (gen_ssse3_pshufbv16qi3 (target, op0, vperm));
@@ -36145,7 +36147,7 @@ expand_vec_perm_1 (struct expand_vec_perm_d *d)
/* Check plain VEC_SELECT first, because AVX has instructions that could
match both SEL and SEL+CONCAT, but the plain SEL will allow a memory
input where SEL+CONCAT may not. */
- if (d->op0 == d->op1)
+ if (d->one_operand_p)
{
int mask = nelt - 1;
bool identity_perm = true;
@@ -36242,7 +36244,7 @@ expand_vec_perm_1 (struct expand_vec_perm_d *d)
return true;
/* Recognize interleave style patterns with reversed operands. */
- if (d->op0 != d->op1)
+ if (!d->one_operand_p)
{
for (i = 0; i < nelt; ++i)
{
@@ -36285,7 +36287,7 @@ expand_vec_perm_pshuflw_pshufhw (struct expand_vec_perm_d *d)
unsigned i;
bool ok;
- if (d->vmode != V8HImode || d->op0 != d->op1)
+ if (d->vmode != V8HImode || !d->one_operand_p)
return false;
/* The two permutations only operate in 64-bit lanes. */
@@ -36357,6 +36359,7 @@ expand_vec_perm_palignr (struct expand_vec_perm_d *d)
gen_lowpart (TImode, d->op0), shift));
d->op0 = d->op1 = d->target;
+ d->one_operand_p = true;
in_order = true;
for (i = 0; i < nelt; ++i)
@@ -36396,14 +36399,14 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d)
if (GET_MODE_SIZE (d->vmode) == 16)
{
- if (d->op0 == d->op1)
+ if (d->one_operand_p)
return false;
}
else if (GET_MODE_SIZE (d->vmode) == 32)
{
if (!TARGET_AVX)
return false;
- /* For 32-byte modes allow even d->op0 == d->op1.
+ /* For 32-byte modes allow even d->one_operand_p.
The lack of cross-lane shuffling in some instructions
might prevent a single insn shuffle. */
dfinal = *d;
@@ -36528,11 +36531,11 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d)
if (nzcnt == 1)
{
- gcc_assert (d->op0 == d->op1);
+ gcc_assert (d->one_operand_p);
nonzero_halves[1] = nonzero_halves[0];
same_halves = true;
}
- else if (d->op0 == d->op1)
+ else if (d->one_operand_p)
{
gcc_assert (nonzero_halves[0] == 0);
gcc_assert (nonzero_halves[1] == 1);
@@ -36571,7 +36574,7 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d)
}
}
}
- else if (d->op0 == d->op1)
+ else if (d->one_operand_p)
return false;
else if (TARGET_AVX2
&& (contents & (q[0] | q[2] | q[4] | q[6])) == contents)
@@ -36628,6 +36631,7 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d)
}
dfinal.op0 = gen_reg_rtx (dfinal.vmode);
dfinal.op1 = dfinal.op0;
+ dfinal.one_operand_p = true;
dremap.target = dfinal.op0;
/* Test if the final remap can be done with a single insn. For V4SFmode or
@@ -36671,7 +36675,7 @@ expand_vec_perm_vpermq_perm_1 (struct expand_vec_perm_d *d)
if (!(TARGET_AVX2
&& (d->vmode == V32QImode || d->vmode == V16HImode)
- && d->op0 == d->op1))
+ && d->one_operand_p))
return false;
contents[0] = 0;
@@ -36699,6 +36703,7 @@ expand_vec_perm_vpermq_perm_1 (struct expand_vec_perm_d *d)
dremap.target = gen_reg_rtx (V4DImode);
dremap.op0 = gen_lowpart (V4DImode, d->op0);
dremap.op1 = dremap.op0;
+ dremap.one_operand_p = true;
for (i = 0; i < 2; ++i)
{
unsigned int cnt = 0;
@@ -36712,6 +36717,7 @@ expand_vec_perm_vpermq_perm_1 (struct expand_vec_perm_d *d)
dfinal = *d;
dfinal.op0 = gen_lowpart (dfinal.vmode, dremap.target);
dfinal.op1 = dfinal.op0;
+ dfinal.one_operand_p = true;
for (i = 0, j = 0; i < nelt; ++i)
{
if (i == nelt2)
@@ -36751,8 +36757,7 @@ expand_vec_perm_vperm2f128 (struct expand_vec_perm_d *d)
return false;
dsecond = *d;
- if (d->op0 == d->op1)
- dsecond.op1 = gen_reg_rtx (d->vmode);
+ dsecond.one_operand_p = false;
dsecond.testing_p = true;
/* ((perm << 2)|perm) & 0x33 is the vperm2[fi]128
@@ -36821,10 +36826,7 @@ expand_vec_perm_vperm2f128 (struct expand_vec_perm_d *d)
vperm2f128 on d->op0 and d->op1. */
dsecond.testing_p = false;
dfirst = *d;
- if (d->op0 == d->op1)
- dfirst.target = dsecond.op1;
- else
- dfirst.target = gen_reg_rtx (d->vmode);
+ dfirst.target = gen_reg_rtx (d->vmode);
for (i = 0; i < nelt; i++)
dfirst.perm[i] = (i & (nelt2 - 1))
+ ((perm >> (2 * (i >= nelt2))) & 3) * nelt2;
@@ -36845,9 +36847,8 @@ expand_vec_perm_vperm2f128 (struct expand_vec_perm_d *d)
return true;
}
- /* For d->op0 == d->op1 the only useful vperm2f128 permutation
- is 0x10. */
- if (d->op0 == d->op1)
+ /* For one operand, the only useful vperm2f128 permutation is 0x10. */
+ if (d->one_operand_p)
return false;
}
@@ -36864,7 +36865,7 @@ expand_vec_perm_interleave3 (struct expand_vec_perm_d *d)
unsigned i, nelt;
rtx (*gen) (rtx, rtx, rtx);
- if (d->op0 == d->op1)
+ if (d->one_operand_p)
return false;
if (TARGET_AVX2 && GET_MODE_SIZE (d->vmode) == 32)
;
@@ -36947,7 +36948,7 @@ expand_vec_perm_vperm2f128_vblend (struct expand_vec_perm_d *d)
if (!TARGET_AVX
|| TARGET_AVX2
|| (d->vmode != V8SFmode && d->vmode != V4DFmode)
- || d->op0 != d->op1)
+ || !d->one_operand_p)
return false;
dfirst = *d;
@@ -36985,6 +36986,7 @@ expand_vec_perm_vperm2f128_vblend (struct expand_vec_perm_d *d)
dsecond = *d;
dsecond.op0 = dfirst.target;
dsecond.op1 = dfirst.target;
+ dsecond.one_operand_p = true;
dsecond.target = gen_reg_rtx (dsecond.vmode);
for (i = 0; i < nelt; i++)
dsecond.perm[i] = i ^ nelt2;
@@ -37009,7 +37011,7 @@ expand_vec_perm_pshufb2 (struct expand_vec_perm_d *d)
if (!TARGET_SSSE3 || GET_MODE_SIZE (d->vmode) != 16)
return false;
- gcc_assert (d->op0 != d->op1);
+ gcc_assert (!d->one_operand_p);
nelt = d->nelt;
eltsz = GET_MODE_SIZE (GET_MODE_INNER (d->vmode));
@@ -37064,7 +37066,7 @@ expand_vec_perm_vpshufb2_vpermq (struct expand_vec_perm_d *d)
unsigned int i, nelt, eltsz;
if (!TARGET_AVX2
- || d->op0 != d->op1
+ || !d->one_operand_p
|| (d->vmode != V32QImode && d->vmode != V16HImode))
return false;
@@ -37132,7 +37134,7 @@ expand_vec_perm_vpshufb2_vpermq_even_odd (struct expand_vec_perm_d *d)
unsigned int i, nelt, eltsz;
if (!TARGET_AVX2
- || d->op0 == d->op1
+ || d->one_operand_p
|| (d->vmode != V32QImode && d->vmode != V16HImode))
return false;
@@ -37491,7 +37493,7 @@ expand_vec_perm_broadcast (struct expand_vec_perm_d *d)
{
unsigned i, elt, nelt = d->nelt;
- if (d->op0 != d->op1)
+ if (!d->one_operand_p)
return false;
elt = d->perm[0];
@@ -37514,7 +37516,7 @@ expand_vec_perm_vpshufb4_vpermq2 (struct expand_vec_perm_d *d)
bool used[4];
if (!TARGET_AVX2
- || d->op0 == d->op1
+ || d->one_operand_p
|| (d->vmode != V32QImode && d->vmode != V16HImode))
return false;
@@ -37715,6 +37717,7 @@ ix86_expand_vec_perm_const (rtx operands[4])
perm[i] = ei;
}
+ d.one_operand_p = true;
switch (which)
{
default:
@@ -37722,51 +37725,39 @@ ix86_expand_vec_perm_const (rtx operands[4])
case 3:
if (!rtx_equal_p (d.op0, d.op1))
- break;
-
+ {
+ d.one_operand_p = false;
+ break;
+ }
/* The elements of PERM do not suggest that only the first operand
is used, but both operands are identical. Allow easier matching
of the permutation by folding the permutation into the single
input vector. */
- for (i = 0; i < nelt; ++i)
- if (d.perm[i] >= nelt)
- d.perm[i] -= nelt;
/* FALLTHRU */
- case 1:
- d.op1 = d.op0;
- break;
-
case 2:
for (i = 0; i < nelt; ++i)
- d.perm[i] -= nelt;
+ d.perm[i] &= nelt - 1;
d.op0 = d.op1;
break;
+
+ case 1:
+ d.op1 = d.op0;
+ break;
}
if (ix86_expand_vec_perm_const_1 (&d))
return true;
- /* If the mask says both arguments are needed, but they are the same,
- the above tried to expand with d.op0 == d.op1. If that didn't work,
- retry with d.op0 != d.op1 as that is what testing has been done with. */
- if (which == 3 && d.op0 == d.op1)
+ /* If the selector says both arguments are needed, but the operands are the
+ same, the above tried to expand with one_operand_p and flattened selector.
+ If that didn't work, retry without one_operand_p; we succeeded with that
+ during testing. */
+ if (which == 3 && d.one_operand_p)
{
- rtx seq;
- bool ok;
-
+ d.one_operand_p = false;
memcpy (d.perm, perm, sizeof (perm));
- d.op1 = gen_reg_rtx (d.vmode);
- start_sequence ();
- ok = ix86_expand_vec_perm_const_1 (&d);
- seq = get_insns ();
- end_sequence ();
- if (ok)
- {
- emit_move_insn (d.op1, d.op0);
- emit_insn (seq);
- return true;
- }
+ return ix86_expand_vec_perm_const_1 (&d);
}
return false;
@@ -37780,7 +37771,7 @@ ix86_vectorize_vec_perm_const_ok (enum machine_mode vmode,
{
struct expand_vec_perm_d d;
unsigned int i, nelt, which;
- bool ret, one_vec;
+ bool ret;
d.vmode = vmode;
d.nelt = nelt = GET_MODE_NUNITS (d.vmode);
@@ -37817,17 +37808,17 @@ ix86_vectorize_vec_perm_const_ok (enum machine_mode vmode,
d.perm[i] -= nelt;
/* Check whether the mask can be applied to the vector type. */
- one_vec = (which != 3);
+ d.one_operand_p = (which != 3);
/* Implementable with shufps or pshufd. */
- if (one_vec && (d.vmode == V4SFmode || d.vmode == V4SImode))
+ if (d.one_operand_p && (d.vmode == V4SFmode || d.vmode == V4SImode))
return true;
/* Otherwise we have to go through the motions and see if we can
figure out how to generate the requested permutation. */
d.target = gen_raw_REG (d.vmode, LAST_VIRTUAL_REGISTER + 1);
d.op1 = d.op0 = gen_raw_REG (d.vmode, LAST_VIRTUAL_REGISTER + 2);
- if (!one_vec)
+ if (!d.one_operand_p)
d.op1 = gen_raw_REG (d.vmode, LAST_VIRTUAL_REGISTER + 3);
start_sequence ();
@@ -37848,6 +37839,7 @@ ix86_expand_vec_extract_even_odd (rtx targ, rtx op0, rtx op1, unsigned odd)
d.op1 = op1;
d.vmode = GET_MODE (targ);
d.nelt = nelt = GET_MODE_NUNITS (d.vmode);
+ d.one_operand_p = false;
d.testing_p = false;
for (i = 0; i < nelt; ++i)
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 96e43a22ca9..b63d774e43f 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1175,14 +1175,14 @@
(parallel [(const_int 0)]))
(vec_select:DF (match_dup 1) (parallel [(const_int 1)])))
(plusminus:DF
- (vec_select:DF (match_dup 1) (parallel [(const_int 2)]))
- (vec_select:DF (match_dup 1) (parallel [(const_int 3)]))))
- (vec_concat:V2DF
- (plusminus:DF
(vec_select:DF
(match_operand:V4DF 2 "nonimmediate_operand" "xm")
(parallel [(const_int 0)]))
- (vec_select:DF (match_dup 2) (parallel [(const_int 1)])))
+ (vec_select:DF (match_dup 2) (parallel [(const_int 1)]))))
+ (vec_concat:V2DF
+ (plusminus:DF
+ (vec_select:DF (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:DF (match_dup 1) (parallel [(const_int 3)])))
(plusminus:DF
(vec_select:DF (match_dup 2) (parallel [(const_int 2)]))
(vec_select:DF (match_dup 2) (parallel [(const_int 3)]))))))]
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 98a6120c975..4b8a6929b1e 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -740,9 +740,6 @@ ia64_handle_model_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
-/* The section must have global and overlaid attributes. */
-#define SECTION_VMS_OVERLAY SECTION_MACH_DEP
-
/* Part of the low level implementation of DEC Ada pragma Common_Object which
enables the shared use of variables stored in overlaid linker areas
corresponding to the use of Fortran COMMON. */
@@ -753,24 +750,18 @@ ia64_vms_common_object_attribute (tree *node, tree name, tree args,
bool *no_add_attrs)
{
tree decl = *node;
- tree id, val;
- if (! DECL_P (decl))
- abort ();
+ tree id;
+
+ gcc_assert (DECL_P (decl));
DECL_COMMON (decl) = 1;
id = TREE_VALUE (args);
- if (TREE_CODE (id) == IDENTIFIER_NODE)
- val = build_string (IDENTIFIER_LENGTH (id), IDENTIFIER_POINTER (id));
- else if (TREE_CODE (id) == STRING_CST)
- val = id;
- else
+ if (TREE_CODE (id) != IDENTIFIER_NODE && TREE_CODE (id) != STRING_CST)
{
- warning (OPT_Wattributes,
- "%qE attribute requires a string constant argument", name);
+ error ("%qE attribute requires a string constant argument", name);
*no_add_attrs = true;
return NULL_TREE;
}
- DECL_SECTION_NAME (decl) = val;
return NULL_TREE;
}
@@ -783,50 +774,31 @@ ia64_vms_output_aligned_decl_common (FILE *file, tree decl, const char *name,
{
tree attr = DECL_ATTRIBUTES (decl);
- /* As common_object attribute set DECL_SECTION_NAME check it before
- looking up the attribute. */
- if (DECL_SECTION_NAME (decl) && attr)
+ if (attr)
attr = lookup_attribute ("common_object", attr);
- else
- attr = NULL_TREE;
-
- if (!attr)
- {
- /* Code from elfos.h. */
- fprintf (file, "%s", COMMON_ASM_OP);
- assemble_name (file, name);
- fprintf (file, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",
- size, align / BITS_PER_UNIT);
- }
- else
+ if (attr)
{
- ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
- ASM_OUTPUT_LABEL (file, name);
- ASM_OUTPUT_SKIP (file, size ? size : 1);
- }
-}
+ tree id = TREE_VALUE (TREE_VALUE (attr));
+ const char *name;
-/* Definition of TARGET_ASM_NAMED_SECTION for VMS. */
+ if (TREE_CODE (id) == IDENTIFIER_NODE)
+ name = IDENTIFIER_POINTER (id);
+ else if (TREE_CODE (id) == STRING_CST)
+ name = TREE_STRING_POINTER (id);
+ else
+ abort ();
-void
-ia64_vms_elf_asm_named_section (const char *name, unsigned int flags,
- tree decl)
-{
- if (!(flags & SECTION_VMS_OVERLAY))
- {
- default_elf_asm_named_section (name, flags, decl);
- return;
+ fprintf (file, "\t.vms_common\t\"%s\",", name);
}
- if (flags != (SECTION_VMS_OVERLAY | SECTION_WRITE))
- abort ();
+ else
+ fprintf (file, "%s", COMMON_ASM_OP);
- if (flags & SECTION_DECLARED)
- {
- fprintf (asm_out_file, "\t.section\t%s\n", name);
- return;
- }
+ /* Code from elfos.h. */
+ assemble_name (file, name);
+ fprintf (file, ","HOST_WIDE_INT_PRINT_UNSIGNED",%u",
+ size, align / BITS_PER_UNIT);
- fprintf (asm_out_file, "\t.section\t%s,\"awgO\"\n", name);
+ fputc ('\n', file);
}
static void
@@ -10536,12 +10508,6 @@ ia64_section_type_flags (tree decl, const char *name, int reloc)
|| strncmp (name, ".gnu.linkonce.sb.", 17) == 0)
flags = SECTION_SMALL;
-#if TARGET_ABI_OPEN_VMS
- if (decl && DECL_ATTRIBUTES (decl)
- && lookup_attribute ("common_object", DECL_ATTRIBUTES (decl)))
- flags |= SECTION_VMS_OVERLAY;
-#endif
-
flags |= default_section_type_flags (decl, name, reloc);
return flags;
}
diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h
index 11f017663b5..3e81d769897 100644
--- a/gcc/config/ia64/vms.h
+++ b/gcc/config/ia64/vms.h
@@ -121,9 +121,6 @@ STATIC func_ptr __CTOR_LIST__[1] \
#undef TARGET_VALID_POINTER_MODE
#define TARGET_VALID_POINTER_MODE ia64_vms_valid_pointer_mode
-#undef TARGET_ASM_NAMED_SECTION
-#define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section
-
/* Define this macro if it is advisable to hold scalars in registers
in a wider mode than that declared by the program. In such cases,
the value is constrained to be within the bounds of the declared
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 19973005be7..3e85fcf3e6c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -6487,7 +6487,9 @@ push_regs (HARD_REG_SET *mask, int interrupt_handler)
use_movml = true;
}
- if (use_movml)
+ if (sh_cfun_resbank_handler_p ())
+ ; /* Do nothing. */
+ else if (use_movml)
{
rtx x, mem, reg, set;
rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
@@ -7485,7 +7487,9 @@ sh_expand_epilogue (bool sibcall_p)
use_movml = true;
}
- if (use_movml)
+ if (sh_cfun_resbank_handler_p ())
+ ; /* Do nothing. */
+ else if (use_movml)
{
rtx sp_reg = gen_rtx_REG (SImode, STACK_POINTER_REGNUM);
diff --git a/gcc/config/vms/make-crtlmap.awk b/gcc/config/vms/make-crtlmap.awk
index 6f82dee7aa8..63be6e708ab 100644
--- a/gcc/config/vms/make-crtlmap.awk
+++ b/gcc/config/vms/make-crtlmap.awk
@@ -40,13 +40,13 @@ BEGIN {
print "{ \"" $1 "\", "
if (NF == 1)
print "0 }"
- else if (NF == 2)
- printf "VMS_CRTL_" $2 " }"
- else if (NF == 3)
- printf "VMS_CRTL_" $2 " | VMS_CRTL_" $3 " }"
else
- # To be fixed.
- exit 1
+ {
+ printf "VMS_CRTL_" $2
+ for (i = 3; i <= NF; i++)
+ printf " | VMS_CRTL_" $i
+ printf " }"
+ }
}
END {
diff --git a/gcc/config/vms/t-vms b/gcc/config/vms/t-vms
index 4e20bde8070..f2161b7861b 100644
--- a/gcc/config/vms/t-vms
+++ b/gcc/config/vms/t-vms
@@ -34,3 +34,8 @@ vms-c.o: $(srcdir)/config/vms/vms-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_P_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(PREPROCESSOR_DEFINES) $< -o $@
+
+vms-f.o: $(srcdir)/config/vms/vms-f.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(PREPROCESSOR_DEFINES) $< -o $@
diff --git a/gcc/config/vms/vms-c.c b/gcc/config/vms/vms-c.c
index 6f8a1cf6138..09172b261ab 100644
--- a/gcc/config/vms/vms-c.c
+++ b/gcc/config/vms/vms-c.c
@@ -120,7 +120,9 @@ vms_pragma_nomember_alignment (cpp_reader *pfile ATTRIBUTE_UNUSED)
if (arg[0] == '_' && arg[1] == '_')
arg += 2;
- if (strcmp (arg, "word") == 0)
+ if (strcmp (arg, "byte") == 0)
+ maximum_field_alignment = 1 * BITS_PER_UNIT;
+ else if (strcmp (arg, "word") == 0)
maximum_field_alignment = 2 * BITS_PER_UNIT;
else if (strcmp (arg, "longword") == 0)
maximum_field_alignment = 4 * BITS_PER_UNIT;
@@ -453,6 +455,9 @@ vms_c_register_includes (const char *sysroot,
void
vms_c_common_override_options (void)
{
+ /* Allow variadic functions without parameters (as declared in starlet). */
+ flag_allow_parameterless_variadic_functions = TRUE;
+
/* Initialize c_default_pointer_mode. */
switch (flag_vms_pointer_size)
{
diff --git a/gcc/config/vms/vms-crtlmap.map b/gcc/config/vms/vms-crtlmap.map
index d98afacc17f..e80e2afe493 100644
--- a/gcc/config/vms/vms-crtlmap.map
+++ b/gcc/config/vms/vms-crtlmap.map
@@ -12,130 +12,483 @@
# - Comment lines start with '#' in the first column.
# - map lines consist in an identifier optionnaly followed by at most 2
# space-separated flags.
-# Flags are:
-# FLOAT: will be prefixed by 't'/'g'/'d'.
-# 64: There is a 64-bit variant.
-# GLOBAL: name will be prefixed by ga_
-# BSD44: name will be prefixed by __bsd44__.
-# LDBL: a 'x' prefix will be added if 128 bit long doubles are enabled.
-# MALLOC: malloc related function.
+# Flags are described in vms.c (prefixed by VMS_CRTL_).
#
# Keep entries alpha-sorted - this is enforced by the awk script.
#
+__32_getpwent
+__32_getpwnam
+__32_getpwuid
+__32_sigaction
__32_signal
__32_ssignal
+__64_getpwent
+__64_getpwnam
+__64_getpwuid
+__64_sigaction
__64_signal
__64_ssignal
+__assert
+__dl__xpv
+__freeaddrinfo32
+__freeaddrinfo64
+__getaddrinfo32
+__getaddrinfo64
+__getaddrinfo_compat4332
+__getaddrinfo_compat4364
+__getgrent64
+__getgrgid64
+__getgrgid_r64
+__getgrnam64
+__getgrnam_r64
+__lgamma FLOAT64 FLOATV2
+__lgammaf FLOAT32 FLOATV2
+__lgammal FLOAT64 FLOAT128 FLOATV2
+__long_gid___32_getpwnam
+__long_gid___32_getpwuid
+__long_gid___64_getpwnam
+__long_gid___64_getpwuid
+__long_gid_access
+__long_gid_chmod
+__long_gid_chown
+__long_gid_fchmod
+__long_gid_fchown
+__long_gid_fstat
+__long_gid_ftw
+__long_gid_getegid
+__long_gid_geteuid
+__long_gid_getgid
+__long_gid_getgroups
+__long_gid_getpwnam
+__long_gid_getpwnam_r 64
+__long_gid_getpwuid
+__long_gid_getpwuid_r 64
+__long_gid_getuid
+__long_gid_lchown
+__long_gid_lstat
+__long_gid_setgid
+__long_gid_setuid
+__long_gid_stat
+__non_utc_ftw
+__nw__xui
+__off64_fcntl
+__off64_fseeko
+__off64_fstat
+__off64_ftello
+__off64_ftruncate
+__off64_ftw
+__off64_long_gid_fstat
+__off64_long_gid_ftw
+__off64_long_gid_lstat
+__off64_long_gid_stat
+__off64_lseek
+__off64_lstat
+__off64_mmap 64
+__off64_non_utc_ftw
+__off64_pread
+__off64_pwrite
+__off64_stat
+__off64_truncate
+__off64_utc_fstat
+__off64_utc_lstat
+__off64_utc_stat
+__pdam_wcsftime
+__pdam_wcstok 64
__posix__exit
__posix_exit
__posix_kill
__posix_long_gid_kill
+__posix_system
+__posix_wait
+__read_rnd
+__recvmsg32 BSD44
+__recvmsg64 BSD44
+__sendmsg32 BSD44
+__sendmsg64 BSD44
+__short_gid___32_getpwent
+__short_gid___64_getpwent
+__short_gid_getpwent
+__std_fstat
+__std_ftw
+__std_lstat
+__std_stat
+__unix_geteuid
__unix_getuid
+__utc_ctime
+__utc_ctime_r
__utc_fstat
+__utc_ftime
+__utc_gmtime
+__utc_gmtime_r
__utc_localtime
__utc_localtime_r
__utc_lstat
+__utc_mktime
+__utc_pdam_wcsftime
__utc_stat
__utc_strftime
__utc_time
+__utc_utime
+__utc_utimes
+__utc_wcsftime
__utctz_gmtime
+__utctz_gmtime_r
__utctz_localtime
__utctz_localtime_r
+__vms_pclose
+__vms_wait3
+__vms_wait4
+__vms_waitpid
+__writev32
+__writev64
+_exit
+_fstat
+a64l
abort
abs
-accept
+accept BSD44
access
-acos FLOAT
+acos FLOAT64 DPML
+acosd FLOAT64_VAXD DPML
+acosdl FLOAT64_VAXD
+acosh FLOAT64_VAXD DPML
+acoshl FLOAT64_VAXD
+acosl FLOAT64_VAXD
alarm
asctime
asctime_r
-asin FLOAT
-atan FLOAT
-atan2 FLOAT
+asin FLOAT64 DPML
+asind FLOAT64_VAXD DPML
+asindl FLOAT64_VAXD
+asinh FLOAT64_VAXD DPML
+asinhl FLOAT64_VAXD
+asinl FLOAT64_VAXD
+atan FLOAT64 DPML
+atan2 FLOAT64 DPML
+atan2l FLOAT64_VAXD
+atand FLOAT64_VAXD DPML
+atand2 FLOAT64_VAXD DPML
+atand2l FLOAT64_VAXD
+atandl FLOAT64_VAXD
+atanh FLOAT64_VAXD DPML
+atanhl FLOAT64_VAXD
+atanl FLOAT64_VAXD
atexit
-atof FLOAT
+atof FLOAT64
atoi
atol
atoll
atoq
-basename 64
+basename 64
bcmp
bcopy
-bsearch 64
+bind BSD44
+box
+# brk
+bsd_mh GA
+bsd_waddbytes
+bsd_waddstr
+bsearch 64
+btowc
bzero
-calloc 64 MALLOC
-ceil FLOAT
+cabs FLOAT64 FLOATV2
+cabsf FLOAT32 FLOATV2
+cabsl FLOAT64 FLOAT128 FLOATV2
+cacos DPML
+cacosh DPML
+calloc 64 MALLOC
+calloc_opt
+carg DPML
+casin DPML
+casinh DPML
+catan DPML
+catanh DPML
+catclose
+catgets 64
+catopen
+cbrt FLOAT64_VAXD
+cbrtl FLOAT64_VAXD
+ccos DPML
+ccosh DPML
+cdiv DPML
+ceil FLOAT64 DPML
+ceill FLOAT64_VAXD
+cexp DPML
+cfree
+cfree_opt
chdir
chmod
chown
clearerr
+clearerr_unlocked
clock
+clock_getres
+clock_gettime
+clock_settime
+clog DPML
close
closedir
-connect
-cos FLOAT
-ctermid 64
+cmul DPML
+cols GA
+confstr
+connect BSD44
+copysign FLOAT64_VAXD DPML
+copysignl FLOAT64_VAXD
+cos FLOAT64 DPML
+cosd FLOAT64_VAXD DPML
+cosdl FLOAT64_VAXD
+cosh FLOAT64 DPML
+coshl FLOAT64_VAXD
+cosl FLOAT64_VAXD
+cot FLOAT64_VAXD DPML
+cotd FLOAT64_VAXD DPML
+cotdl FLOAT64_VAXD
+cotl FLOAT64_VAXD
+cpow DPML
+creat
+crtl_init
+crypt 64
+csin DPML
+csinh DPML
+csqrt DPML
+ctan DPML
+ctanh DPML
+ctermid 64
ctime
+ctime_r
+cuserid 64
+daylight GL
+delete
+delwin
+difftime FLOAT64
+dirname 64
+div
dlclose
dlerror
dlopen
dlsym
+drand48 FLOAT64
+drem DPML
dup
dup2
-environ GLOBAL
+ecvt FLOAT64
+encrypt
+endgrent
+endhostent
+endnetent
+endprotoent
+endpwent
+endservent
+endwin
+environ GA
+erand48 FLOAT64
+erf FLOAT64_VAXD DPML
+erfc FLOAT64_VAXD DPML
+erfcl FLOAT64_VAXD
+erfl FLOAT64_VAXD
+errno GA
+execl
+execle
+execlp
execv
execve
execvp
exit
-exp FLOAT
-fabs FLOAT
+exp FLOAT64 DPML
+expl FLOAT64_VAXD
+expm1 FLOAT64_VAXD DPML
+expm1l FLOAT64_VAXD
+fabs FLOAT64 DPML
+fabsl FLOAT64_VAXD
+fchmod
+fchown
fclose
fcntl
+fcvt FLOAT64
fdopen
feof
+feof_unlocked
ferror
+ferror_unlocked
fflush
ffs
fgetc
-fgetname 64 MALLOC
-fgets 64
+fgetc_unlocked
+fgetname 64
+fgetpos
+fgets 64
+fgetwc
+fgetws 64
fileno
-floor FLOAT
+finite FLOAT64_VAXD DPML
+finitel FLOAT64_VAXD
+flockfile
+floor FLOAT64 DPML
+floorl FLOAT64_VAXD
+fmod FLOAT64 DPML NODPML FLOATV2
+fmodf FLOAT32 NODPML FLOATV2
+fmodl FLOAT64 FLOAT128 NODPML FLOATV2
+# fnmatch # Overridden by libiberty.
fopen
+fp_class FLOAT64_VAXD DPML
+fp_classl FLOAT64_VAXD
fpathconf
-fprintf FLOAT LDBL
+fprintf FLOAT64 FLOAT128
+fprintf__cf FLOAT64 FLOAT128
fputc
+fputc_unlocked
fputs
+fputwc
+fputws
fread
free
+free_opt
+freeaddrinfo
+freehostent
freopen
-frexp FLOAT
+frexp FLOAT64 DPML
+frexpl FLOAT64_VAXD
+fscanf FLOAT64 FLOAT128
fseek
+fseeko
+fsetpos
+fstat
+fstatvfs
+fsync
ftell
+ftello
+ftime
+ftruncate
+ftrylockfile
+ftw
+funlockfile
+fwait
+fwide
+fwprintf FLOAT64 FLOAT128
fwrite
+fwscanf FLOAT64 FLOAT128
+gai_strerror
+gamma FLOAT64 FLOATV2
+gammaf FLOAT32 FLOATV2
+gammal FLOAT64 FLOAT128 FLOATV2
+gbsd_mvprintw
+gbsd_mvscanw
+gbsd_mvwprintw
+gbsd_mvwscanw
+gbsd_printw
+gbsd_scanw
+gbsd_wprintw
+gbsd_wscanw
+gcvt FLOAT64 64
+get_errno_addr
+get_vms_errno_addr
+getaddrinfo
+getaddrinfo_compat43
getc
+getc_unlocked
getchar
-getcwd 64
+getchar_unlocked
+getclock
+getcwd 64
+getdtablesize
getegid
getenv
geteuid
getgid
-gethostbyaddr
-gethostbyname
-getname
+getgrent
+getgrgid
+getgrgid_r
+getgrnam
+getgrnam_r
+getgroups
+gethostaddr
+gethostbyaddr BSD44
+gethostbyname BSD44
+gethostent
+gethostname
+getipnodebyaddr
+getipnodebyname
+getitimer
+getlogin
+getlogin_r
+getname 64
+getnameinfo
+getnetbyaddr
+getnetbyname
+getnetent
+getopt 32ONLY
getpagesize
+getpeername BSD44
+getpgid
+getpgrp
getpid
+getppid
+getprotobyname
+getprotobynumber
+getprotoent
getpwent
getpwnam
+getpwnam_r 64
+getpwuid
+getpwuid_r 64
+gets 64
getservbyname
getservbyport
+getservent
+getsid
+getsockname BSD44
getsockopt
gettimeofday
getuid
+getw
+getwc
+getwchar
+glob 64
+globfree 64
gmtime
+gmtime_r
+gsignal
+herror
+hostalias
+hstrerror
+htonl
htons
+hypot FLOAT64 DPML NODPML FLOATV2
+hypotf FLOAT32 NODPML FLOATV2
+hypotl FLOAT64 FLOAT128 NODPML FLOATV2
iconv
-index 64
+iconv_close
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+ilogb DPML
+index 64
+inet6_opt_append
+inet6_opt_find
+inet6_opt_finish
+inet6_opt_get_val
+inet6_opt_init
+inet6_opt_next
+inet6_opt_set_val
+inet6_rth_add
+inet6_rth_getaddr
+inet6_rth_init
+inet6_rth_reverse
+inet6_rth_segments
+inet6_rth_space
+inet_addr
+inet_aton
+inet_lnaof
+inet_makeaddr
+inet_netof
+inet_network
+inet_ntoa
+inet_ntop
+inet_pton
+initscr
+initstate
ioctl
isalnum
isalpha
@@ -146,128 +499,432 @@ iscntrl
isdigit
isgraph
islower
+isnan FLOAT64_VAXD DPML
+isnanl FLOAT64_VAXD
isprint
ispunct
isspace
isupper
+iswalnum
+iswalpha
+iswcntrl
+iswctype
+iswdigit
+iswgraph
+iswlower
+iswprint
+iswpunct
+iswspace
+iswupper
+iswxdigit
isxdigit
+j0 FLOAT64_VAXD DPML
+j0l FLOAT64_VAXD
+j1 FLOAT64_VAXD DPML
+j1l FLOAT64_VAXD
+jn FLOAT64_VAXD DPML
+jnl FLOAT64_VAXD
+jrand48
kill
-ldexp FLOAT
+l64a
+l64a_r
+labs
+lchown
+lcong48
+ldexp FLOAT64 DPML
+ldexpl FLOAT64_VAXD
+ldiv
+lgamma FLOAT64 DPML NODPML FLOATV2
+lgammaf FLOAT32 NODPML FLOATV2
+lgammal FLOAT64 FLOAT128 NODPML FLOATV2
+lines GA
+link
+listen
+llabs
+lldiv
locale
localeconv
localtime
localtime_r
-log FLOAT
-log10 FLOAT
+# ln -> log DPML
+log FLOAT64 FLOATV2
+log10 FLOAT64 DPML
+log10l FLOAT64_VAXD
+log1p FLOAT64_VAXD DPML
+log1pl FLOAT64_VAXD
+log2 FLOAT64_VAXD DPML
+log2l FLOAT64_VAXD
+logb FLOAT64_VAXD DPML
+logbl FLOAT64_VAXD
+logf FLOAT32 FLOATV2
+logl FLOAT64 FLOAT128 FLOATV2
longjmp
+longname 64
+lrand48
+lround DPML
lseek
-malloc 64 MALLOC
-mbstowcs 64
-memchr 64
+lstat
+lwait
+malloc 64 MALLOC
+malloc_opt
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs 64
+mbstowcs
+mbtowc
+memccpy 64
+memchr 64
memcmp
-memcpy 64
-memmove 64
-memset 64
+memcpy 64
+memmove 64
+memset 64
mkdir
mkstemp
-mktemp 64
-mmap 64
+mktemp 64
+mktime
+mmap 64
+modf FLOAT64 DPML
+modfl FLOAT64_VAXD
+mprotect
+mrand48
+msync
munmap
+mvwaddstr
+mvwin
nanosleep
+newwin
+nextafter FLOAT64_VAXD DPML
+nextafterl FLOAT64_VAXD
+nice
+nint FLOAT64_VAXD DPML
+nintl FLOAT64_VAXD
nl_langinfo
+nrand48
+ntohl
+ntohs
open
opendir
+optarg GA 32ONLY
+opterr GL 32ONLY
+optind GL 32ONLY
+optopt GL 32ONLY
+overlay
+overwrite
pathconf
+pause
pclose
perror
pipe
+poll
popen
-pow FLOAT
-printf FLOAT LDBL
+# pow DPML version ???
+pow FLOAT64 FLOATV2
+powf FLOAT32 FLOATV2
+powl FLOAT64 FLOAT128 FLOATV2
+pread
+printf FLOAT64 FLOAT128
+printf__cf FLOAT64 FLOAT128
+printw FLOAT64 FLOAT128
putc
+putc_unlocked
putchar
+putchar_unlocked
putenv
puts
-qsort 64
+putw
+putwc
+putwchar
+pwrite
+qabs
+qdiv
+qsort 64
raise
+rand
+rand_r
random
read
readdir
-realloc 64 MALLOC
+readdir_r 64
+readlink
+readv 64
+realloc 64 MALLOC
+realloc_opt
+realpath 64
+record_read
recv
-recvfrom
-recvmsg BSD44 64
+recvfrom BSD44
+recvmsg BSD44
+remainder DPML
remove
rename
rewind
-rindex 64
+rewinddir
+rindex 64
+rint FLOAT64_VAXD DPML
+rintl FLOAT64_VAXD
rmdir
-scanf FLOAT LDBL
+rtl_private
+# sbrk # Makes libiberty/xmalloc.c fails to build.
+scalb FLOAT64_VAXD DPML
+scalbl FLOAT64_VAXD
+scanf FLOAT64 FLOAT128
+scanw FLOAT64 FLOAT128
+scroll
+seed48
+seekdir
select
send
-sendmsg BSD44 64
-sendto
+sendmsg BSD44
+sendto BSD44
+set_new_handler__xpxv_v
setbuf
setenv
+seteuid
+setgid
+setgrent
+sethostent
+setitimer
+setkey
setlocale
+setnetent
+setpgid
+setpgrp
+setprotoent
setpwent
+setregid
+setreuid
+setservent
+setsid
setsockopt
+setstate
+setuid
setvbuf
+shm_open
+shm_unlink
+shutdown
+sigaction
+sigaddset
+sigblock
+sigdelset
+sigemptyset
+sigfillset
+sighold
+sigignore
+sigismember
siglongjmp
+sigmask
signal
+signgam GL
+sigpause
+sigpending
+sigprocmask
+sigrelse
sigsetjmp
sigsetmask
-sin FLOAT
+sigstack
+sigsuspend
+sigtimedwait
+sigvec
+sigwait
+sigwaitinfo
+sin FLOAT64 DPML
+sincos DPML
+sincosd DPML
+sind FLOAT64_VAXD DPML
+sindl FLOAT64_VAXD
+sinh FLOAT64 DPML
+sinhcosh DPML
+sinhl FLOAT64_VAXD
+sinl FLOAT64_VAXD
sleep
-snprintf FLOAT LDBL
+snprintf FLOAT64 FLOAT128
socket
-sprintf FLOAT LDBL
-sqrt FLOAT
-sscanf FLOAT LDBL
+socketpair
+sprintf FLOAT64 FLOAT128
+sprintf__cf FLOAT64 FLOAT128
+sqrt FLOAT64 DPML
+sqrtl FLOAT64_VAXD
+srand
+srand48
+srandom
+sscanf FLOAT64 FLOAT128
+ssignal
stat
+statvfs
strcasecmp
-strcat 64
-strchr 64
+strcat 64
+strchr 64
strcmp
-strcpy 64
+strcoll
+strcpy 64
strcspn
-strdup 64 MALLOC
+strdup 64 MALLOC
strerror
+strfmon FLOAT64
+strftime
strlen
strncasecmp
-strncat 64
+strncat 64
strncmp
-strncpy 64
-strpbrk 64
-strrchr 64
+strncpy 64
+strnlen
+strpbrk 64
+strptime 64
+strptime_xpg4
+strrchr 64
+strsep 64
strspn
-strstr 64
-strtod 64 FLOAT
-strtok 64 MALLOC
-strtok_r 64 MALLOC
-strtol 64
-strtoul 64
+strstr 64
+strtod FLOAT64 64
+strtok 64
+strtok_r 64
+strtol 64
+strtoll 64
+strtoq 64
+strtoul 64
+strtoull 64
+strtouq 64
+strxfrm
+subwin
+swab
+swprintf FLOAT64 FLOAT128
+swscanf FLOAT64 FLOAT128
+symlink
+sys_errlist GA
+sys_nerr GL
sysconf
system
-tan FLOAT
+tan FLOAT64 DPML
+tand FLOAT64_VAXD DPML
+tandl FLOAT64_VAXD
+tanh FLOAT64 DPML
+tanhl FLOAT64_VAXD
+tanl FLOAT64_VAXD
+telldir
tempnam
+tgamma DPML
time
times
+timezone GL
tmpfile
-tmpnam 64
+tmpnam 64
+toascii
tolower
+touchwin
toupper
+towctrans
+towlower
+towupper
+trunc FLOAT64_VAXD DPML
+truncate
+truncl FLOAT64_VAXD
ttyname
+ttyname_r
+tzname GA
+tzset
+ualarm
umask
+uname
ungetc
+ungetwc
unlink
+unordered FLOAT64_VAXD DPML
+unorderedl FLOAT64_VAXD
+unsetenv
usleep
utime
-vfprintf FLOAT LDBL
-vprintf FLOAT LDBL
-vsnprintf FLOAT LDBL
-vsprintf FLOAT LDBL
+utimes
+vaxc$calloc_opt
+vaxc$cfree_opt
+vaxc$crtl_init
+vaxc$errno GA
+vaxc$free_opt
+vaxc$get_sdc
+vaxc$malloc_opt
+vaxc$realloc_opt
+vfprintf FLOAT64 FLOAT128
+vfscanf FLOAT64 FLOAT128
+vfwprintf FLOAT64 FLOAT128
+vfwscanf FLOAT64 FLOAT128
+vprintf FLOAT64 FLOAT128
+vscanf FLOAT64 FLOAT128
+vsnprintf FLOAT64 FLOAT128
+vsprintf FLOAT64 FLOAT128
+vsscanf FLOAT64 FLOAT128
+vswprintf FLOAT64 FLOAT128
+vswscanf FLOAT64 FLOAT128
+vwprintf FLOAT64 FLOAT128
+vwscanf FLOAT64 FLOAT128
+waddch
+waddstr
wait
+wait3
+wait4
waitpid
+wclear
+wclrattr
+wclrtobot
+wclrtoeol
+wcrtomb
+wcscat 64
+wcschr 64
+wcscmp
+wcscoll
+wcscpy 64
+wcscspn
+wcsftime
+wcslen
+wcsncat 64
+wcsncmp
+wcsncpy 64
+wcspbrk 64
+wcsrchr 64
+wcsrtombs 64
+wcsspn
+wcsstr 64
+wcstod FLOAT64 64
+wcstok 64
+wcstol 64
+wcstombs
+wcstoul 64
+wcswcs 64
wcswidth
+wcsxfrm
+wctob
+wctomb
+wctrans
+wctype
+wcwidth
+wdelch
+wdeleteln
+werase
+wgetch
+wgetstr
+winch
+winsch
+winsertln
+winsstr
+wmemchr 64
+wmemcmp
+wmemcpy 64
+wmemmove 64
+wmemset 64
+wmove
+wprintf FLOAT64 FLOAT128
+wprintw FLOAT64 FLOAT128
+wrefresh
write
+writev
+wscanf FLOAT64 FLOAT128
+wscanw FLOAT64 FLOAT128
+wsetattr
+wstandend
+wstandout
+y0 FLOAT64_VAXD DPML
+y0l FLOAT64_VAXD
+y1 FLOAT64_VAXD DPML
+y1l FLOAT64_VAXD
+yn FLOAT64_VAXD DPML
+ynl FLOAT64_VAXD
diff --git a/gcc/config/vms/vms-f.c b/gcc/config/vms/vms-f.c
new file mode 100644
index 00000000000..3c3ba414380
--- /dev/null
+++ b/gcc/config/vms/vms-f.c
@@ -0,0 +1,31 @@
+/* VMS support needed only by Fortran frontends.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+
+void
+vms_c_register_includes (const char *sysroot ATTRIBUTE_UNUSED,
+ const char *iprefix ATTRIBUTE_UNUSED,
+ int stdinc ATTRIBUTE_UNUSED)
+{
+ /* No-op for fortran. */
+}
diff --git a/gcc/config/vms/vms.c b/gcc/config/vms/vms.c
index a85fb3fb209..d4ebd18730b 100644
--- a/gcc/config/vms/vms.c
+++ b/gcc/config/vms/vms.c
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "target.h"
#include "output.h"
+#include "tm.h"
+#include "dwarf2out.h"
/* Correlation of standard CRTL names with DECCRTL function names. */
@@ -36,19 +38,46 @@ along with GCC; see the file COPYING3. If not see
/* If long pointer are enabled, use _NAME64 instead. */
#define VMS_CRTL_64 (1 << 1)
-/* Use tNAME instead. To be applied after the previous rule. */
-#define VMS_CRTL_FLOAT (1 << 2)
+/* Prepend s/f before the name. To be applied after the previous rule.
+ use 's' for S float, 'f' for IEEE 32. */
+#define VMS_CRTL_FLOAT32 (1 << 2)
-/* Prepend __bsd44__ before the name. To be applied after the P64
- rule. */
-#define VMS_CRTL_BSD44 (1 << 3)
+/* Prepend t/g/d before the name. To be applied after the previous rule.
+ use 'g' for VAX G float, 'd' for VAX D float, 't' for IEEE 64. */
+#define VMS_CRTL_FLOAT64 (1 << 3)
+
+/* Prepend d before the name, only if using VAX fp. */
+#define VMS_CRTL_FLOAT64_VAXD (1 << 4)
/* Prepend x before the name for if 128 bit long doubles are enabled. This
concern mostly 'printf'-like functions. */
-#define VMS_CRTL_LDBL (1 << 4)
+#define VMS_CRTL_FLOAT128 (1 << 5)
+
+/* From xxx, create xxx, xxxf, xxxl using MATH$XXX_T, MATH$XXX_S
+ and MATH$XXX{_X} if DPML is used. */
+#define VMS_CRTL_DPML (1 << 6)
-/* Prepend ga_ for global data. */
-#define VMS_CRTL_GLOBAL (1 << 5)
+/* Together with DPML, it means that all variant (ie xxx, xxxf and xxxl) are
+ overridden by decc. Without DPML, it means this is a variant (ie xxxf
+ or xxxl) of a function. */
+#define VMS_CRTL_NODPML (1 << 7)
+
+/* Prepend __bsd44_ before the name. To be applied after the P64
+ rule. */
+#define VMS_CRTL_BSD44 (1 << 8)
+
+/* Define only in 32 bits mode, as this has no 64 bit variants.
+ Concerns getopt/getarg. */
+#define VMS_CRTL_32ONLY (1 << 9)
+
+/* GLobal data prefix (ga_, gl_...) */
+#define VMS_CRTL_G_MASK (7 << 10)
+#define VMS_CRTL_G_NONE (0 << 10)
+#define VMS_CRTL_GA (1 << 10)
+#define VMS_CRTL_GL (2 << 10)
+
+/* Append '_2'. Not compatible with 64. */
+#define VMS_CRTL_FLOATV2 (1 << 13)
struct vms_crtl_name
{
@@ -84,14 +113,14 @@ vms_add_crtl_xlat (const char *name, size_t nlen,
{
tree targ;
+ /* printf ("vms crtl: %.*s -> %.*s\n", nlen, name, id_len, id_str); */
+
targ = get_identifier_with_length (name, nlen);
gcc_assert (!IDENTIFIER_TRANSPARENT_ALIAS (targ));
IDENTIFIER_TRANSPARENT_ALIAS (targ) = 1;
TREE_CHAIN (targ) = get_identifier_with_length (id_str, id_len);
VEC_safe_push (tree, gc, aliases_id, targ);
-
- /* printf ("vms: %s (%p) -> %.*s\n", name, targ, id_len, id_str); */
}
/* Do VMS specific stuff on builtins: disable the ones that are not
@@ -116,7 +145,48 @@ vms_patch_builtins (void)
const struct vms_crtl_name *n = &vms_crtl_names[i];
char res[VMS_CRTL_MAXLEN + 3 + 9 + 1 + 1];
int rlen;
- int nlen;
+ int nlen = strlen (n->name);
+
+ /* Discard 32ONLY if using 64 bit pointers. */
+ if ((n->flags & VMS_CRTL_32ONLY)
+ && flag_vms_pointer_size == VMS_POINTER_SIZE_64)
+ continue;
+
+ /* Handle DPML unless overridden by decc. */
+ if ((n->flags & VMS_CRTL_DPML)
+ && !(n->flags & VMS_CRTL_NODPML))
+ {
+ const char *p;
+ char alt[VMS_CRTL_MAXLEN + 3];
+
+ memcpy (res, "MATH$", 5);
+ rlen = 5;
+ for (p = n->name; *p; p++)
+ res[rlen++] = TOUPPER (*p);
+ res[rlen++] = '_';
+ res[rlen++] = 'T';
+
+ /* Double version. */
+ if (!(n->flags & VMS_CRTL_FLOAT64))
+ vms_add_crtl_xlat (n->name, nlen, res, rlen);
+
+ /* Float version. */
+ res[rlen - 1] = 'S';
+ memcpy (alt, n->name, nlen);
+ alt[nlen] = 'f';
+ vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
+
+ /* Long double version. */
+ res[rlen - 1] = (LONG_DOUBLE_TYPE_SIZE == 128 ? 'X' : 'T');
+ alt[nlen] = 'l';
+ vms_add_crtl_xlat (alt, nlen + 1, res, rlen);
+
+ if (!(n->flags & (VMS_CRTL_FLOAT32 | VMS_CRTL_FLOAT64)))
+ continue;
+ }
+
+ if (n->flags & VMS_CRTL_FLOAT64_VAXD)
+ continue;
/* Add the dec-c prefix. */
memcpy (res, "decc$", 5);
@@ -124,27 +194,49 @@ vms_patch_builtins (void)
if (n->flags & VMS_CRTL_BSD44)
{
- memcpy (res + rlen, "__bsd44__", 9);
- rlen += 9;
+ memcpy (res + rlen, "__bsd44_", 8);
+ rlen += 8;
}
- if (n->flags & VMS_CRTL_GLOBAL)
+ if ((n->flags & VMS_CRTL_G_MASK) != VMS_CRTL_G_NONE)
{
- memcpy (res + rlen, "ga_", 3);
- rlen += 3;
+ res[rlen++] = 'g';
+ switch (n->flags & VMS_CRTL_G_MASK)
+ {
+ case VMS_CRTL_GA:
+ res[rlen++] = 'a';
+ break;
+ case VMS_CRTL_GL:
+ res[rlen++] = 'l';
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ res[rlen++] = '_';
}
- if (n->flags & VMS_CRTL_FLOAT)
+ if (n->flags & VMS_CRTL_FLOAT32)
+ res[rlen++] = 'f';
+
+ if (n->flags & VMS_CRTL_FLOAT64)
res[rlen++] = 't';
- if (n->flags & VMS_CRTL_LDBL)
+ if ((n->flags & VMS_CRTL_FLOAT128) && LONG_DOUBLE_TYPE_SIZE == 128)
res[rlen++] = 'x';
- nlen = strlen (n->name);
memcpy (res + rlen, n->name, nlen);
if ((n->flags & VMS_CRTL_64) == 0)
- vms_add_crtl_xlat (n->name, nlen, res, rlen + nlen);
+ {
+ rlen += nlen;
+
+ if (n->flags & VMS_CRTL_FLOATV2)
+ {
+ res[rlen++] = '_';
+ res[rlen++] = '2';
+ }
+ vms_add_crtl_xlat (n->name, nlen, res, rlen);
+ }
else
{
char alt[VMS_CRTL_MAXLEN + 3];