[llvm-commits] [llvm-gcc-4.2] r43378 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Lauro Ramos Venancio lauro.venancio at gmail.com
Mon Oct 29 10:55:30 PDT 2007


Hi Dale,

This patch broke the llvm-gcc compilation for arm-linux.

Lauro


/home/laurov/tester/llvm-gcc-4.2/build/./gcc/xgcc
-B/home/laurov/tester/llvm-gcc-4.2/build/./gcc/
-B/opt/crosstool/gcc-4.1.2-glibc-2.5/arm-linux-gnueabi/arm-linux-gnueabi/bin/
-B/opt/crosstool/gcc-4.1.2-glibc-2.5/arm-linux-gnueabi/arm-linux-gnueabi/lib/
-isystem /opt/crosstool/gcc-4.1.2-glibc-2.5/arm-linux-gnueabi/arm-linux-gnueabi/include
-isystem /opt/crosstool/gcc-4.1.2-glibc-2.5/arm-linux-gnueabi/arm-linux-gnueabi/sys-include
-O2  -O2 -g -O2  -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE   -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include  -fPIC -g
-DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I.
-I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber
-I../libdecnumber -I/home/laurov/tester/llvm/include
-I/home/laurov/tester/llvm/build/include -DL_clear_cache
-fvisibility=hidden -DHIDE_EXPORTS -c ../../gcc/libgcc2.c -o
libgcc/./_clear_cache.o
../../gcc/libgcc2.c: In function '__clear_cache':
../../gcc/libgcc2.c:2039: error: Invalid or unsupported inline assembly!


Preprocessed code:

# 74 "../../gcc/libgcc2.c" 2
# 2034 "../../gcc/libgcc2.c"
void
__clear_cache (char *beg __attribute__((__unused__)),
        char *end __attribute__((__unused__)))
{

  { register unsigned long _beg __asm ("a1") = (unsigned long) (beg);
register unsigned long _end __asm ("a2") = (unsigned long) (end);
register unsigned long _flg __asm ("a3") = 0; register unsigned long
_scno __asm ("r7") = 0xf0002; __asm __volatile ("swi 0x9f0002		@
sys_cacheflush" : "=r" (_beg) : "0" (_beg), "r" (_end), "r" (_flg),
"r" (_scno)); };

}



2007/10/26, Dale Johannesen <dalej at apple.com>:
> Author: johannes
> Date: Thu Oct 25 22:29:56 2007
> New Revision: 43378
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43378&view=rev
> Log:
> (inline asm) don't canonicalize single-hard-reg
> constraints; they're already canonical.
>
>
> Modified:
>     llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
>
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=43378&r1=43377&r2=43378&view=diff
>
> ==============================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Oct 25 22:29:56 2007
> @@ -3526,6 +3526,7 @@
>      if (IsInOut)
>        ++NumInOut, ++NumInputs;
>
> +    std::string SimplifiedConstraint;
>      // If this output register is pinned to a machine register, use that machine
>      // register instead of the specified constraint.
>      if (TREE_CODE(Operand) == VAR_DECL && DECL_HARD_REGISTER(Operand)) {
> @@ -3539,14 +3540,14 @@
>          memcpy(NewConstraint+2, reg_names[RegNum], RegNameLen);
>          NewConstraint[RegNameLen+2] = '}';
>          NewConstraint[RegNameLen+3] = 0;
> -        Constraint = NewConstraint;
> +        SimplifiedConstraint = NewConstraint;
>        }
> +    } else {
> +      // If we can simplify the constraint into something else, do so now.  This
> +      // avoids LLVM having to know about all the (redundant) GCC constraints.
> +       SimplifiedConstraint = CanonicalizeConstraint(Constraint+1);
>      }
>
> -    // If we can simplify the constraint into something else, do so now.  This
> -    // avoids LLVM having to know about all the (redundant) GCC constraints.
> -    std::string SimplifiedConstraint = CanonicalizeConstraint(Constraint+1);
> -
>      LValue Dest = EmitLV(Operand);
>      const Type *DestValTy =
>        cast<PointerType>(Dest.Ptr->getType())->getElementType();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list