+1  A: 

If push %ebp is causing a segfault, then your stack pointer isn't pointing at valid stack. How does control reach that point? What platform are you on, and is there anything odd about the runtime environment? At the entry to the function, %esp should point to the return address in the caller on the stack. Does it?

Aside from that, the whole function is pretty weird. You go out of your way to set the rounding bits in the fp control word, and then don't perform any operations that are affected by rounding. All the function does is copy some data, but uses floating-point registers to do it when you could use the integer registers just as well. And then there's the spurious emms, which you need after using MMX instructions, not after doing x87 computations.

Edit See Scott's (the original questioner) answer for the actual reason for the crash.

Stephen Canon
Control's reached by calling the function pointer. The content of the function pointer is what is being compiled in the function I've provided in the question. obj->run is the function pointer. I'm on Linux. I'm not sure how to check the last concern in the first paragraph. As for the rounding bits, the loop in that function is used to compile lots of different scenarios, so I imagine it's there for a purpose. I didn't write this though, so I'm not positive about it. Also, AvsNumber (the C type of variables inside the JIT environment) is a float, so I think it's proper to use float registers.
Scott
+1  A: 

The problem had nothing to do with the code. Adding -z execstack to the linker fixed the problem.

Scott
Ah, that makes sense.
Stephen Canon