http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45927

           Summary: autoconf regression wrt .quad availability targeting
                    amd64 from biarch cross compiler
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jay.kr...@cornell.edu


Regression in 4.5.1 vs. 4.3.5 (sorry, we skipped 4.4)

    gcc_GAS_CHECK_FEATURE([.quad directive],
      gcc_cv_as_ix86_quad,,,
      [.quad 0],,
      [AC_DEFINE(HAVE_AS_IX86_QUAD, 1,
        [Define if your assembler supports the .quad directive.])])


This breaks cross builds to Solaris/amd64.
  You can then easily trigger this path:


const char *
integer_asm_op (int size, int aligned_p)
{
  struct asm_int_op *ops;

  if (aligned_p)
    ops = &targetm.asm_out.aligned_op;
  else
    ops = &targetm.asm_out.unaligned_op;


  switch (size)
    {
    case 1:
      return targetm.asm_out.byte_op;
    case 2:
      return ops->hi;
    case 4:
      return ops->si;
    case 8:
      return ops->di;  <= NULL, but wasn't NULL in 4.3.5

...
bool
default_assemble_integer (rtx x ATTRIBUTE_UNUSED,
              unsigned int size ATTRIBUTE_UNUSED,
              int aligned_p ATTRIBUTE_UNUSED)
{
  const char *op = integer_asm_op (size, aligned_p);
  /* Avoid GAS bugs for large values.  Specifically negative values whose
     absolute value fits in a bfd_vma, but not in a bfd_signed_vma.  */
  if (size > UNITS_PER_WORD && size > POINTER_SIZE / BITS_PER_UNIT)
    return false;
  return op && (assemble_integer_with_op (op, x), true);  <== NULL => false,
but was presumably true in 4.3.5
}


bool
assemble_integer (rtx x, unsigned int size, unsigned int align, int force)
{
  int aligned_p;

  aligned_p = (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT));

  /* See if the target hook can handle this kind of object.  */
  if (targetm.asm_out.integer (x, size, aligned_p))
    return true;  <= no longer hit this

...
      if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode,
                       EXPAND_INITIALIZER),
                  MIN (size, thissize), align, 0))
 ==>    error ("initializer for integer/fixed-point value is too complicated");
      break;



They worked fine in gcc 4.3 when this autoconfigury was absent.
gcc 4.3 assumed .quad was available in biarch x86.
Probably the autoconfigury is close to correct.
It should be used perhaps, but only for guiding 32bit compilation.


I verified the problem is related to:

/* The 32-bit Solaris assembler does not support .quad.  Do not use it.  */
#ifndef HAVE_AS_IX86_QUAD
#undef ASM_QUAD
#endif



gcc-4.5/gcc/config/i386/sol2.h


which wasn't in 4.3.5.

4.3.5 instead had:


/* The 32-bit Solaris assembler does not support .quad.  Do not use it.  */
#ifndef TARGET_BI_ARCH
#undef ASM_QUAD
#endif

Reply via email to