Re: [PATCH] fix signed range problems with hex conversions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Wed, 30 May 2007, Linus Torvalds wrote:
> 
> With this, gcc can just generate:
> 
> 	movzbl  (%rdi), %eax
>	...

Btw, in the kernel we have a rule for *.c -> *.s files exactly because 
it's nice to be able to easily say "ok, what does that generate". 

Here's a patch to add such a rule to git too, in case anybody is 
interested. It makes it much simpler to just do

	make sha1_file.s

and look at the compiler-generated output that way, rather than having to 
fire up gdb on the resulting binary.

(Add -fverbose-asm or something if you want to, it can make the result 
even more readable)

		Linus

---
diff --git a/Makefile b/Makefile
index 7527734..7ffb803 100644
--- a/Makefile
+++ b/Makefile
@@ -846,6 +846,8 @@ git$X git.spec \
 
 %.o: %.c GIT-CFLAGS
 	$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
+%.s: %.c GIT-CFLAGS
+	$(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
 %.o: %.S
 	$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
 
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux